Jump to content
  • Advertisement
Sign in to follow this  
xujiezhige

How to understand vector projection

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I find the following sentences in DXSDK.

However, if the normal points away from the light, the vertex is extruded to infinity. [color=#ff0000]This is done by making the vertex's world coordinates the same as the light-to-vertex vector with a W value of 0. The effect of this operation is that all faces facing away from the light get projected to infinity along the light direction.

I know the result of the red line, but I don't know the math about it. Can you tell me the math in it?

Share this post


Link to post
Share on other sites
Advertisement
We are using homogeneous coordinates, where we represent points in three-dimensional space with four numbers, but where we consider that proportional coordinates (e.g. [1:2:0:1] and [2:4:0:2]) represent the same point. The resulting space is called projective space. If one considers the points that have non-zero last coordinate, they all have representatives of the form [x:y:z:1], and they look pretty much like conventional three-dimensional affine space. The remaining points have 0 last coordinate, and they correspond to "points at infinity". If you take parallel lines in affine space and look at the corresponding lines in projective space, they actually have an intersection, and the intersection point is one of these "points at infinity".

Hopefully that helps to frame the issue a bit.

Share this post


Link to post
Share on other sites
Thank you very much, alvaro.

So if the point is ( 1, 2, 0, 0 ), we can consider the point is moved along ( 1, 2, 0) vector to infinity?

Am i right?

Share this post


Link to post
Share on other sites

So if the point is ( 1, 2, 0, 0 ), we can consider the point is moved along ( 1, 2, 0) vector to infinity?

Am i right?


Yes. I prefer to word it as this: (1,2,0,0) is the point at infinity where all parallel lines along (1,2,0) meet. Notice the direction (1,2,0) is the same as (2,4,0) and (-3,-6,0), because they are all proportional.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!