# Projecting into a 2D plane

This topic is 4916 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi. im having trouble projecting vectors into a 2D plane. if i have the x,y,z coordinates of two points in space, how can i know were will the projection of the line joining those two points lie on the x , y or z planes ? i think this might be done using matrices, but how ? i'de be very grateful if anyone help me with this.

##### Share on other sites
If the equation of your plane is Ax + By + Cz + D = 0, where N = [A, B, C] and length( N ) == 1, then the projection of a point P onto the plane is P - ( N dot P + D ) * N

##### Share on other sites
thank you very much for your help.

##### Share on other sites
one more thing though, is the multiplication per componenet or do u mean cross product by that?

##### Share on other sites

P - ( N dot P + D ) * N

Then (N.P+D) is a scalar value, so (N.P+D)*N is just a scalar multiplication (per component).

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 13
• 9
• 9
• 15
• 14
• ### Forum Statistics

• Total Topics
634070
• Total Posts
3015330
×