Archived

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

Another Question? Projection / Parallel Vectors

This topic is 4948 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 hope I''m not abusing this fabulous resource by asking my second question in as many days. I''m having a bit more trouble with some of the fundamentals presented in 3D Math Primer. I had asked a question about a projection equation (finding vparallel when projecting v onto n). I got a great answer, but now reading on a couple of chapters (page 110 specifically) I''m confused again. This chapters deals with rotating a vector about an arbitrary axis. When projecting a vector, v onto another vector, n the equation for finding vpar (parallel) is given in the book (chapter 5, page 61) as... vpar = n ( v.n / |n|squared ) I understand this formula and how it is derived. But then later in the book, the authors state that vpar can be found using... vpar = n ( v.n ) Where did the divisor |n|squared go? What am I missing here? I''m sure there is a simple explanation for this, but it''s these little unexplained mysteries that make this stuff difficult for a beginner like me to follow. Is it common to rotate a vector about an arbitrary axis? Or are things typically rotated around one of the cardinal axes? One more small question: when multiplication is inferred (when squaring a vector or writing something like n(v.n) where n and v are vectors) is it safe to assume that it''s always the dot product being carrying out as multiplication? Does n squared mean n.n?

Share this post


Link to post
Share on other sites
multiplying/dividing by scalar values (such as ||n||^2) doesn''t change the direction, but rather the magnitude. No, vector multiplication can either be the dot product or cross product, although if I was to give an ACTUAL definition for the multiplication for vectors, I would say it is (u.v)^2 + (uxv)^2. This is because u.v can be written as ||u||*||v||*cos(y), and uxv can be written as ||u||*||v||*sin(y). It is readily visible why I say that is vector multiplication, that being said

Share this post


Link to post
Share on other sites
I think I understand what you're getting at here. I guess I didn't think far enough ahead. As an example, when I have n(v.n) where n and v are vectors, there isn't a vector multiplication operation that is ambiguous, despite what I first thought. I get a scalar from n.v, and that scalar is multiplied with the vector n. So there isn't an ambiguous vector multiplication operation in there as I once thought. I guess vector mutiplication will always be made clear (dot product versus cross product).

Any ideas on the main question of the post?


[edited by - Low Bias on May 31, 2004 11:42:44 AM]

Share this post


Link to post
Share on other sites
I''ve personally never had the need to rotate a vector about an axis, but maybe if you give me a sense of what you''re trying to do (beyond I''m trying to rotate a vector around an axis) I may be able to help, because I''m a bit in the dark right now since I never really thought about it before.

Share this post


Link to post
Share on other sites
I''m not trying to do anything specific, just learn the theory I''ll need to write 3D games. I''m reading Tricks of the 3D Game Programming Gurus and this book, 3D Math Primer is a side trip. There were some spots in LaMothe''s book that left me wanting a better explanation (although it is a great book).

Rotating about one of the cardinal axes is fairly straight forward, and I can see the application of it. But rotating about an arbitrary axis seems less than trivial, but less useful? I don''t know that I''ll ever need to do it, but I want to understand everything in the book before I proceed.

The main thing for me is why is the equation for vpar different in the two cases presented?

Share this post


Link to post
Share on other sites
Are you sure you didn't miss some qualifier when the author stated vpar = n ( v.n )? Such as n being a unit vector (a vector of length 1)...

[edited by - Muzzafarath on May 31, 2004 1:27:08 PM]

Share this post


Link to post
Share on other sites
Hmmm, as a matter of fact I did miss the fact that it''s a unit vector. My apologies, this is all new to me.

*sigh*

Forgive my ignorance, but because it''s a unit vector, the |n|squared term evaluates to 1 and can be removed? And we still multiply by the vector n for direction?

Share this post


Link to post
Share on other sites
|n| is the length of the vector n (that's a definition). If the length of n is 1, then |n| = 1, which means |n|^2 = 1^2 = 1. So yeah, you can just remove it Yes, you still multiply by n to get the proper direction.

[edited by - Muzzafarath on May 31, 2004 2:28:04 PM]

Share this post


Link to post
Share on other sites