Sign in to follow this  

Help with matrix transformations

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