Object orientation(rotation) with respect to camera

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
saransiva_ps
Posts: 3
Joined: Thu Jun 19, 2008 6:52 am

Object orientation(rotation) with respect to camera

Post by saransiva_ps »

We are using a camera system that will rotate with respect a fixed target. The camera is transformed (rotated) only when the mouse button is pressed and moved. An object (say a cylinder) is oriented in a particular direction (using setRotation function, given an angle). The object is aligned with camera in its initial position. The object(cylinder) is moved by mapping it with the mouse movement i.e., when the mouse is moved, the object gets translated in the scene.

When the camera is rotated in the scene by pressing the mouse button, we would like to orient the object along with camera, so as to preserve its initial alignment. Could any one help me on how to achieve it.
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, not sure what you really want to do. But using addChild could help, as the object would be moved along with the camera (if chosing the camera as parent).
Post Reply