[Solved] Problem with camera
Posted: Wed Jan 23, 2019 2:35 pm
Ogre Version:1.11
I have implemented a simple third person camera that works with the Razor model. Now I am trying to make it work with the Robot model and have a problem.
When activating this code it puts me behind the Razor model 500 units. I have rotated the Robot model to match the orientation of the Razor but when I try to activate the third person camera it isn't positioned behind the Robot but to the side. I am pretty sure the Robot mesh's starting position is the culprit but I don't know how to account for it.
I tried this
There was no noticeable change.
I have implemented a simple third person camera that works with the Razor model. Now I am trying to make it work with the Robot model and have a problem.
Code: Select all
Vector3 newCamPosition = mNode->getOrientation() * Vector3(0, 0, 500) * Vector3::UNIT_Z;
mNode->addChild(camNode);
camNode->setPosition(newCamPosition);
I tried this
Code: Select all
Vector3 robotCorrection = mNode->getOrientation() * Vector3::UNIT_X;
Vector3 newCamPosition = robotCorrection * Vector3(0, 0, 500) * Vector3::UNIT_Z;
mNode->addChild(camNode);
camNode->setPosition(newCamPosition);