Archive 17/01/2023.

Camera at origin

AReichl

Hi,
is it possible in Urho3D to keep the camera at origin (meaning shifting the whole scene around the camera)?
In Ogre for example there is an option for it.
If i would have to program it myself, could it be done with an “empty” node which is the parent of all other nodes and only does transformations (reverse to the camera movements / rotation )?

cadaver

Yes, it can be done with parenting all your content to a node. The scene itself cannot be moved/rotated/scaled due to transform calculation optimizations and to avoid weird mistakes where the whole scene would be e.g. scaled.

AReichl

Ok - WHERE should i connect the camera to - the “RootSceneNode” or the above mentioned empty-only-transformation scene node?

Modanung

The camera should have it’s own node directly parented to the Scene (not the RootSceneNode).
When the RootSceneNode is moved, the camera should not move along.

AReichl

My fault - i am more used to Irrlicht and with “RootSceneNode” i meant what you call “Scene”.

Modanung

Ah right… I assumed the RootSceneNode would be the name of the node you’d create. So yea, that’s what the Scene is. Scene is actually a subclass of Node.
If the camera needn’t move nor rotate I guess you could add the Camera component directly to the Scene… and everything else would be parented to your world node which could move through the scene.