camera direction
Posted: Tue Sep 28, 2010 12:31 pm
Hi,
Is there a way to get which direction the camera is facing?
Is there a way to get which direction the camera is facing?
Official forum of the Irrlicht Engine
https://irrlicht.sourceforge.io/forum/
Code: Select all
ICameraSceneNode *pCamera = pSceneManager->getActiveCamera();
vector3df pos = pCamera->getAbsolutePosition();
vector3df target = pCamera->getTarget();
vector3df dir = target - pos;
Code: Select all
pCamera = smgr->getActiveCamera();
pos = pCamera->getAbsolutePosition();
target = pCamera->getTarget();
dir = target - pos;
node->setPosition(dir);
Code: Select all
node->setPosition(dir*100);
Code: Select all
node->setPosition(pos + dir.normalize() * distance);
Code: Select all
pCamera->setTarget(node->getAbsolutePosition())