Archived

This topic is now archived and is closed to further replies.

Vector Project Equation Question

This topic is 4944 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 am reading 3D Math Primer (great book) and there is on part of the projection math that is bugging me (page 61 specifically). I''m going to be a bit wordy here in the hopes that you all might catch any misunderstandings I have. If I have a vector, v that I want to project onto another vector, n I might start by splitting v into vpar (parallel to n) and vper (perpendicular to n). We can get vpar by multiplying the magnitude of vpar by the normalized (unit) n with... vpar = n(|vpar| / |n|) ...makes good sense. We can substitute cos(theta)|v| to get the magnitude of vpar... vpar = n(|v|cos(theta) / |n|) ...all good to here. At this point, the book seems to multiply the right side of the equation by |n| / |n| to end up with the intermediate... vpar = n(|v||n|cos(theta) / |n|squared) .before getting the final equation... vpar = n(v.n / |n|squared) I see this same equation for calculating vpar in Tricks of the 3D Game Programming Gurus, but I''m confused about the extra |n| in the equation. Is it added simply so we can substitute (use) the dot product? Apologies if this is a stupid question. I really want to understand this before I proceed. Also, as an aside...I''m a bit of an obsessive person. I have a hard time accepting rules without fully understanding them. The problem with that attitude as it relates to 3D programming is that I''m no math whiz, so formal proofs can make my head spin. Is the fact that the cross product of two vectors gives us a perpendicular vector just one of the beauties of math? Or was it designed / engineered to do that for the sake of computer graphics?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yes, they just multiply by |n|/|n| to get to the final equation, which is more useful because it is easier to compute.

The cross product was designed to get a perpendicular vector, and it was created before computer graphics. It is used in physics to calculate things like torque (the cross product of displacement from the center of mass of an object and the force acting on the object at that point). It is just something that is pretty useful when working in 3 dimensions.

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Yes, they just multiply by |n|/|n| to get to the final equation, which is more useful because it is easier to compute.


Thanks! You''re the goods! I thought that was too simple an answer.

quote:
The cross product was designed to get a perpendicular vector, and it was created before computer graphics. It is used in physics to calculate things like torque (the cross product of displacement from the center of mass of an object and the force acting on the object at that point). It is just something that is pretty useful when working in 3 dimensions.


Wow. More than my money''s worth. Thanks again, Anonymous Poster.

Share this post


Link to post
Share on other sites