I have an ICameraSceneNode* camera in my scene, i used camera->setPosition(vector3df(100, 30, 200)) to set it above a terrain.
Now i need to reset the Camera coordinates to be (0, 0, 0) without moving back to 0, 0, 0! ....
I hope you got what i am trying to say here ...
And now when i move the camera again, lets say to 10, 30, 50, i want its coordinates to be 0, 0, 0 after moving to that position!
Any idea how to reset a node coordinates!... no matter where it moves, i want its coordinates to move with it.
How can i change a node's coordinates!
Well, I think this is not possible...
But you could use 2 empty scene nodes for this...
But you could use 2 empty scene nodes for this...
- 1. set the cam to the new position
2. set a empty node to the same position
3. make the cam a chhild of the empty node
4. set cam position to 0,0,0
- 1. set the cam to the new position
2. set the other empty node to the same position (with cam->getAbsolutePosition() )
3. make the cam a child of the empty node and remove it from the first
4. set cam position to 0,0,0
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Presumably you just want to update the cameras location by a vector, like 10, 30, 50 as you said, but adding that vector on to the current positon, instead of setting it to that actual position in the world.
All you have to do is camera->setPosition(camera->getPosition() + vector3d(10,30,50))
I would have thought...
All you have to do is camera->setPosition(camera->getPosition() + vector3d(10,30,50))
I would have thought...
-
- Posts: 322
- Joined: Tue Aug 30, 2005 10:34 am
- Location: slovakia
if you want your camera coords allways 0,0,0, doeas it mean you attach something to that camera? becouse if you make a child node, the node will be relative to the camera parent, thus camera have (0,0,0) coords for everything that is its child.... and childs can freely move in the space of their parents
what is this thing...