Sign in to follow this  
Alessandro

Help with matrix transformations

Recommended Posts

Alessandro    302
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
WilyCoder    100
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
kajjait    130
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this