Sign in to follow this  
Alex Pavel

How can i apply transformation matrix to mesh?

Recommended Posts

We can answer your question, but it probably wont help. Open a book on opengl d3d or game mathematics...

Transforming a mesh means mathematically converting the vertex coordinates from one coordinate space (like object space) to another (like world space or camera space).

When rendering, this is normally done by the grapgics api (and hardware), so you suppily the matrix (or matricies), then you suppily the mesh verticies in object space. The rendering api (and your shader) transforms the mesh into camera space, then screen space, during rendering.

If you need to transform something on the cpu, you jut multiply the vertex (x,y,z) by the transformation matrix. There are normally functions to do this for you, or you can look up matrix math on wikipedia.

Fyi, matrix math is not communitative, so order matters. Also opengl and d3d typically organize transformation matricies differently, which affects the direction operations are performed in.

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