Ответ на сообщение пользователя pakirrote
I'm creating a scene first person test. And to interact with objects.
The problem is that when I want to interact with them is difficult, if the mouse was hidden without being in the center of the screen. Also when I do not click on the canvas first, the "W", "A", "S", "D" keys, move in reverse direction.
My code: http://pastebin.com/1tXVSrrN
There is no code which deals with character->objects interaction under your link, so If I understood you correctly, you want to use mouse position to check if there are some interactive objects on the screen. Actually, there are better/easier solutions exist.
First - you can just use the center of the screen to check for objects. The center is canvas width/2; canvas height/2. Then x,y can be used in the https://www.blend4web.com/api_doc/module-scenes.html#.pick_object
function like this:
var canvas = m_container.get_canvas();
var x = canvas.width;
var y = canvas.height;
var obj = m_scenes.pick_object(x, y);
But this solution is not the fastest one.
The best approach is to use physical "picker" which must be parented to the camera and to register if it is in collision with some required object.