2
$\begingroup$

I've been trying to write a script that receives the xyz coordinates of a vertex of a 3D object and returns the xyz coordinates of the vertex in a prespective projection plane, more or less like in the following image:

enter image description here

Example:

get_prespective(3,4,8):
     bla...
     new_vector = [3,4,0]
     return new_vector

Supposedly you need to multiply the vector with a prespective matrix, like this:

enter image description here

Or multiplying the vector by this matrix:

enter image description here

But I'm having some trouble figuring out which matrix to use or how to use it. If somebody has a better idea, that would be great ;)

$\endgroup$
0

0

Browse other questions tagged .