Sign in to follow this  
bazeragi

transforming Vector 3 by a 4x4 matrix

Recommended Posts

Hi i am trying to make a software renderer and i have got up to getting it into 3D, i have made a projection matrix but im not sure how i can transform the vector 3 by the matrix. I am doing it without using directx or anything like that so could anyone tell me how to do this or any site that might tell me? do i need to add a fourth element (x,y,z,w)? any help would be appreciated

Share this post


Link to post
Share on other sites
How you transform the vector depends on what it represents. If it represents a point, like a vertex, you use a w coordinate of 1. If it represents a direction, like a normal, you use a w coordinate of 0.

Share this post


Link to post
Share on other sites
Ah thanks yea its to represent a point so i will use 1 for w
anouther question after it has been transformed by the matrix how do i actually make it a vector 2 because it will still come out as a vector 3.
Thanks

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