Jump to content
  • Advertisement
Sign in to follow this  

What up with 'Y-Up' ???

This topic is 4908 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've got my hands on some camera code that makes a view transform, seems to work fine but its using lefthanded y-up and I need lefthanded z-up. Here is the code I have.
Matrix4 rotationMatrix;
m_orientation.ToRotationMatrix(rotationMatrix); // quaternion to matrix

// Make the translation relative to axes
Matrix4 tmp(-rotationMatrix);
tmp(3,3) = 1.0f;
Vector3 trans = m_position.GetTransformedCoord(tmp);

// Make final matrix
rotationMatrix(3, 0) = trans.x;
rotationMatrix(3, 1) = trans.y;
rotationMatrix(3, 2) = trans.z;

return rotationMatrix;

I thought I could just rotate the 'rotationMatrix' by 90deg around the X axis but that doesnt seem to work. I know I should figure out exactly what is going one here but until I do, does anyone know how to make view matrix I need?

Share this post

Link to post
Share on other sites
If you want Z to be up, why don't you use an RH system? It will make a lot more intuitive sense...

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!