Jump to content
  • Advertisement
Sign in to follow this  
Alessandro

Help with matrix transformations

This topic is 4255 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

Suppose i have a quad glTranslated at 0,0,-100 with the following vertices: -20, -20 20, -20 20, 20 -20, 20 Say i translate the quad and scale it, how do i calculate new vertices positions ?

Share this post


Link to post
Share on other sites
Advertisement
You are trying to compute object to world coordinates.

You should write your own matrix class.

WorldVertex = ScaleMatrix * RotationMatrix * Translation Matrix * Vertex;

Share this post


Link to post
Share on other sites
lets say you have an object. inside of that object there is a matrix that defines the objects translation, orientation, and scale in 3d space. if you wanted to get a vert position in the world all you would have to do is multiply your vert position with your objects matrix, like WilyCoder said. if you arent too familiar with matrices you should pick up a linear algebra book. i think there are a few out there that focus on 3d graphics. in the mean time i found a pretty crappy linear algebra tutorial online here: matrix multiply

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!