Aight so I am working on a SFML-inspired wrapper for SFML
Kind of like adding a sf::Renderer class that supports 3D coordinates (Opposed to do direct OpenGL calls in
sf::Drawable::Render).
Anyway to my problem. I am implementing right now a class that would be a 3D version of
sf::Drawable that I call
Graphics::Object that has a 4x4 matrix where the 3x3 section contains the 3D rotation which is calculated like this:
Stolen from Wikipedia What I want is convert the 3x3 section of the matrix to a vector with dimension 3. Currently my API looks like this:
void SetRotation( const Vector3f aRotation );
void SetRotation( const float anX, const float anY, const float anZ );
Matrix33f GetRotation() const;
But I want it to look like this:
void SetRotation( const Vector3f aRotation );
void SetRotation( const float anX, const float anY, const float anZ );
Vector3f GetRotation() const;
Notice the change in the return value type of GetRotation()So is there any magical mathematician here that knows how to do that?
I myself have problem with math. But well I have the standard mathematical vector and matrix operations implemented and working.
Would it be easy enough to just have a Zero-vector and multiply it with the matrix?
return Vector3f::Zero * myMatrix.Get33();
EDIT: Well after some thought... that would just give me another zero vector wouldn't it?What I want the returned vector to represent is the amount of rotation for each axis.