Hello, Sandy again,
I have a game which includes a directional light source. The source is controlled with the keyboard, the direction of the light is controlled with the mouse.
demo (click on the frame to give it focus, use the arrow keys and mouse to control)
This is all well and good but controlling the light is difficult and feels counter intuitive. Having it stick to a static point (the mouse location) while the source jumps around doesn't feel natural.
What I would like to do is have the light look in the direction of the MOTION of the mouse.
This is similar to how first person shooters are controlled, the mouse is constantly re-centered and the view changes based on the distance traveled on each frame.
The issue is that I haven't found any way to re-center the mouse on each frame, and so there is no way to keep it on the sensing area of the stage.
Does anyone know of a way to either control the mouse position, or get this effect through other means?