Latexluv opened this issue on Jun 04, 2010 · 182 posts
Sentinelle posted Sun, 13 June 2010 at 12:08 PM
Quote - ... Far easier for Poser is to calculate the cosine of the angle. I don't know if you are familiar with vector math, but it turns out that given two vectors, P and Q, the cosine of the angle between them is trivially given by computing the dot product of P and Q, as long as the vectors are unit length. In math notation, you actually write a dot between them, but I don't know how to type such a thing, so I'll just say P dot Q.
So - why is P dot Q so cheap? Because it is simply:
P.x * Q.x + P.y * Q.y + P.z * Q.z
...
So Poser has a super trivial way to compute cos(alpha) without doing any transcendental math at all. And this very neatly gives a value of 1 when the surface points straight at the camera, and 0 when it points away to the side. Values in between decrease monotonically from 1 to 0.
...
Bagginsbill, thanks so much for taking the time to explain how the Edge_Blend node works mathematically. I remember having seen the dot product in my distant past while in college. I've always been fascinated by linear algebra and calculus although I'm not very good with math. I'm pleasantly surprised to learn that linear algebra and calculus are used extensively in computer graphics. For those of us who constantly struggle with math, we really need someone like you, BB, to simplify the math involved in CG and to help us understand the beauty of math as it is absolutely essential to digital art.
How does Poser avoid division by zero in D/cos(alpha) when alpha = 90 degrees? Does alpha ever reach 90 in Poser?