Jump to content
  • Advertisement
Sign in to follow this  
Daggerbot

Matrix Management

This topic is 2723 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'm currently having trouble figuring out which order to apply matrix transformations in. My camera object has position (translation) and rotation properties, while my mesh instances have position, rotation and scale properties. I've always been told to multiply matrices in the order: scale, rotate, then translate. In this case, since I want to scale only the mesh, and not the coordinate system in general, I would scale last instead. But there's still a problem. Translating after rotating seems to translate based on the direction of the camera/mesh, which is not what I want, and rotating after translating seems to rotate around the origin [0,0,0], rather the position of the mesh. Is there a simple way to apply the properties of my camera and mesh instances with these properties, or do I need to completely rethink things? Any help is appreciated.

EDIT: After a few more minutes of googling, I found the solution. Transforming the matrix using (A = B * A), rather than (A = A * B), applies the transformation from the origin.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!