• Create Account

## Math for 3d programming

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1ryan mccabe  Members

161
Like
0Likes
Like

Posted 20 April 2011 - 12:38 PM

Just picked up the book Mathematics for 3d Game Programming by Eric Lengyl and Ive realized I need a precursor to it. My last math course was math 30 pure and I'm finding it hard to find something to fill the gap. The book starts with vector math for example, googling it for tutorials hasn't gotten me anywhere. There are tutorials but the dont match up with the proofs in the book. Most of what I see in the book I can work out but the proof for ||aP|| = |a| ||P|| is completely beyond me. Maybe its just the normalized notation thats throwing me off but why the root sum of a^2 P^2 is |a| ||P|| confuses me. Why do the variables get normalized when the square root is taken, if I'm writing that right (dont know how to post mathematical notations)?

Anyone know of a good place to get the gap between highschool math and this book filled in? Ill be taking university math courses in the fall as prep for 3d game programming but for now Id like to work through this book.

Thanks,
Ryan.

### #2Splinter of Chaos  Members

239
Like
0Likes
Like

Posted 20 April 2011 - 01:26 PM

||apP|| = |a||P|: This is true assuming a and P are vectors facing the same or opposite directions. After all, a*P = |a||P|cos(theta) so |aP|=|a||P||cos(theta)|, where theta is the angle between a and P. So if theta=0, |a*P| = |a||P|*1=|aP|. If theta=pi, |aP|=|a||P||-1|=|aP|.

a^2*P2 = |a||P|: This is not true at all. It implies a^2=|a| and P^2=|P|, when in fact |a|=sqrt(a^2). If you give a and P values (like a=<x0,y0> and P=<x1,y1>) you can instantly disprove that statement except for when |a|=1 and |P|=1.

Vectors are normalized after taking the square root: Again, not true. A vector is normalized when it is of length one. This happens when you divide a vector by its magnitude.
//Example
a=<3,4>

|a| = sqrt(9 + 16) = 5
n  = a/5 = <3/5,4/5>  // n for Normal
|n| = sqrt( 9/25 + 16/25) = 1

Either what you're reading is inaccurate or there are some things you're not understanding yet. Hope this helps.

### #3ryan mccabe  Members

161
Like
0Likes
Like

Posted 20 April 2011 - 03:20 PM

a^2*P2 = |a||P| i think should read sqrt(Σa2 Pi2) = |a||P|, where i=1. I'm sure its me and not the book, but your post is concise enough that I think I know what to read up on now to get a proper foothold.

Edit for future reference: |a| ||P|| = ||aP|| is referring to Positive homogeneity or positive scalability. |a| is an absolute scaler while ||P|| is a magnitude.

### #4Jesse7  Members

158
Like
1Likes
Like

Posted 29 April 2011 - 09:42 AM

Most of what I see in the book I can work out but the proof for ||aP|| = |a| ||P|| is completely beyond me. Maybe its just the normalized notation thats throwing me off but why the root sum of a^2 P^2 is |a| ||P|| confuses me.

Let P be a vector and a a scalar. There are scalars x_1, x_2, x_3 such that P = (x_1, x_2, x_3). aP = (ax_1, ax_2, ax_3) is always a vector by the vector space axioms. So just take the norm of aP:.

||aP|| = sqrt( (ax_1)^2 + (ax_2)^2 + (ax_3)^2) = sqrt(a^2(x_1^2 + x_2^2 + x_3^2)) = sqrt(a^2) * sqrt (x_1^2 + x_2^2 + x_3^2) = |a| ||P||. I don't know of any books for bridging the gap. This stuff comes from vector calculus but you also see it in linear algebra.
Good judgment comes from experience; experience comes from bad judgment.

### #5BCullis  Members

1951
Like
0Likes
Like

Posted 29 April 2011 - 02:53 PM

If you do a search on youtube for Linear Algebra MIT, you can find an entire semester's worth of Linear Algebra courses that should give you all the groundwork you need.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.