This project is read-only.

Retrieving Camera Rotation

May 5, 2014 at 4:41 PM
Pretty much as the title states, I'm not sure where I'm going wrong exactly.

I couldn't find a method that returns it so I fetched the matrix but the matrix that is being returned is larger than a 3x3 which is confusing me a little.

Any advice would be appreciated.

May 5, 2014 at 9:05 PM
Edited May 6, 2014 at 1:00 PM
Might as well add this here: updating a 3D volume texture? I've got my own code to do this using map / unmap but was wondering if there were methods already built into the engine.
May 6, 2014 at 4:03 PM
If you want the orientation of one of the entity or node classes (which make up the spatial portion of all of the Actor classes) then you can access it through the Entity3D::Rotation() method, which returns a 3x3 matrix:
Matrix3f orientation = pActor->GetNode()->Rotation();
For the second question, can you please create a second discussion tab so that the discussion is easier for others to find?

I hope that helps!
May 6, 2014 at 9:14 PM
How do I extract x, y, z axis rotations from the matrix? Matrix deconstruction?
May 7, 2014 at 2:40 AM
There aren't any methods in the Matrix3f class. However, if you take a look at the Matrix4f class there are methods called GetBasisX, GetBasisY, and GetBasisZ. These just return certain rows of the matrix. This isn't necessarily correct, but with the way that the engine uses matrices it ends up working correctly. Once you get the basis directions, you should be able to calculate how large of a rotation there is from the standard basis.

Does that make sense and/or clear up the question?
May 7, 2014 at 10:04 AM
Certainly does, thank you for the help!