transforming Vector 3 by a 4x4 matrix

Started by
2 comments, last by Numsgil 14 years, 10 months ago
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
Advertisement
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.
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
Just ignore the z and w components. Your 3D homogenous vector is now a simple 2D one.
[size=2]Darwinbots - [size=2]Artificial life simulation

This topic is closed to new replies.

Advertisement