Page 1 of 1

How to force the rotation of the camera based on a matrix?

Posted: Sun May 10, 2015 9:04 am
by swuth
Hi,

I am porting a previously existing game over to Ogre. I want to basically copy the rotation matrix of the games current camera (which is maintained by the game) and brute force the ogre camera to copy its rotation (the position was easy :))

Their doesnt appear to be a setRotation. Anyone have any ideas on this?

Cheers

Swuth

Re: How to force the rotation of the camera based on a matri

Posted: Sun May 10, 2015 9:56 pm
by NotCamelCase
You can form a Quaternion using a rotation matrix to use in Camera::setOrientation() call: http://www.ogre3d.org/docs/api/1.9/clas ... 67f89a15b1

Re: How to force the rotation of the camera based on a matri

Posted: Sun May 10, 2015 10:38 pm
by swuth
After switching rows and columns on the original matrix, setting the columns of my Ogre::Matrix3 and then generating a quat, and setting the cameraquat, ALL IS WELL! Thanks a million!