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

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
swuth
Bronze Sponsor
Bronze Sponsor
Posts: 53
Joined: Wed Mar 25, 2015 10:01 pm

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

Post 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
NotCamelCase
Greenskin
Posts: 140
Joined: Sun Feb 03, 2013 6:32 pm
x 8

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

Post 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
Check out my projects: https://github.com/NotCamelCase
swuth
Bronze Sponsor
Bronze Sponsor
Posts: 53
Joined: Wed Mar 25, 2015 10:01 pm

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

Post 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!
Post Reply