CameraRotator -> attaching Camera to a SceneNode

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
Yavin
Bronze Sponsor
Bronze Sponsor
Posts: 140
Joined: Wed Mar 02, 2005 3:41 pm
Location: Lake Constance, Germany
Contact:

CameraRotator -> attaching Camera to a SceneNode

Post by Yavin »

I read the article in the Wiki and tried to adapt this for my situation. I pick a entity with a mousclick and if the entity is showing the BB (is selected) I want to rotate the cam around the selected object. I realize this by creating a new SceneNode which gets the same position as the entities SceneNode. Then I attach the cam to the new node and calculate the new relative position to it. The cam shouldn't not move at this point. The absolute position shouldn't change.

I'm have an failure in my calculations maybe but I didn't understand what happens to the cams position if I attach it!? And what happens if detaching? Do I have to calculate the absolute pos again so that no jump of the position appears?
User avatar
Raven
Goblin
Posts: 203
Joined: Wed Mar 23, 2005 1:07 pm
Location: Melbourne, Australia
Contact:

Post by Raven »

The camera, once attached to a scene node will have its position in the world relative to that node.
When you detach the camera it will go back to being relative to the root node of the scene manager that created it.
I used up all my sick days, so I'm calling in dead.
Post Reply