1
votes

I can easily draw the projection of a 3D set of points onto the plane with normal vector (1,1,1), by using the matrix

    (-sqrt(3)/2   sqrt(3)/2   0)
    (-1/2         -1/2        1).

I want to do the same thing, but for a projection onto an arbitrary plane with normal vector (a,b,c) instead of (1,1,1). How to find the matrix?

Thanks in advance!

EDIT: rephrasing of the question:

When viewing from (1,1,1), the three unit vectors are projected to (-sqrt(3)/2, -1/3), (sqrt(3)/2, -1/2), (0,1). (Up to a scaling factor which doesn't matter.)

I want to find the projection of the three unit vectors when viewed from (a,b,c) instead of (1,1,1).

2
possible duplicate of 3d to 2d Projection Matrix - Joren
It is not, this other questions asks the same thing, but supposing he already knows the (x, y) coordinates of three projected points; I don't. - leipäjuusto

2 Answers

0
votes

Back when I wrote such a code, I simply used wikipedia's nice article on this topic.

There are additional ressources available here and here. There is also a related question on SO.

0
votes

I'm afraid you're can't stuck with 3x2 matrix in arbitrary plane case. Here is a great paper for exactly what you're looking for.