When I move the camera, I use these commands:
Code: Select all
camera->setTarget(core::vector3df(1,2,3));
camera->setPosition(core::vector3df(0,0,0));
The camera's target updates just as it should. However, y and z components are off by about 0.5. I'm focusing on some very small objects (of size 0.06 and 0.017), so this offset is very important to me.
Oddly enough, when I create a new camera like this:
Code: Select all
smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(1,2,3));
the camera is positioned exactly the way I want it. Why is this? It's probably a bad idea to create a new camera every time I want it to move... but what am I doing wrong with changing the position of the camera?
Any help would be appreciated!
EDIT: If I do this:
Code: Select all
smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(1,2,3));
camera->setTarget(core::vector3df(1,2,3));
camera->setPosition(core::vector3df(0,0,0));
the camera is positioned properly. However, I'm wasting system resources by continually creating new cameras, so I'd like to reposition the camera without having to create a new one. Thanks!