Camera Position Change on Mouse move

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Nuelle
Posts: 3
Joined: Sun Jun 27, 2004 11:20 pm

Camera Position Change on Mouse move

Post by Nuelle »

Hi,

i would like the camera to move in a circle over a table, when i move the mouse. It should head always the middle of the table. That means it should fly like a circleanimator over the table, but just if i move the mouse left or right. Can sb help me plz?

so long
Mindl
Posts: 16
Joined: Wed Jun 30, 2004 1:42 am

Moving camera with mouse

Post by Mindl »

You can add a conditonal statement to the OnEvent function to check if the mouse has changed since the last frame using EMIE_MOUSE_MOVED, then use the event.MouseInput.X or event.MouseInput.Y to compare to the old value of the mouse position which you would need to store in a variable. Based on how much it has changed you can then determine how much you need to rotate the camera's parent node. This way the camera stays looking at its parent node, but also rotates around the table based on the mouse movements. Hope this helps.

-Mindl
Nuelle
Posts: 3
Joined: Sun Jun 27, 2004 11:20 pm

Post by Nuelle »

ok, thx, ill try this
Post Reply