calculating normal vectors

Started by
4 comments, last by pedro87 5 years, 6 months ago

I am trying to understand calculating normal vectors in my game engine book. I am having issues understanding a specific section about using gradient to calculate the normal vector. I have attached an image of the page, basically i am unsure where the gradient is coming into play, or just really anything thats going on, on the page. Any help would be appreciated. 

bookpage.png

Advertisement

It does say that it is not carried out often by game engines but I guess it's just teaching it because...well I'm not sure, just incase I guess.

 

I'm more stuck on what the math is actually saying rather than what it is doing. It is saying the the vector n is found by using the gradient of the ellipsoid at p. Is that what that equation is, the f (p) = x^2 +y^2/4 +z^2 -1 is that the gradient of the ellipsoid at p? And then it gets differentiated? 

 

As you can probably tell my math is not at a level which it should be for this. 

Yes.  It says the equation for the surface of the thing is f(p), and the equation for the normal to the surface f(p) is perpendiculart to grad f(p).  The upside-down triangle thingie (nabla) is the symbol used to represent the gradient operator, and it refers to a vector-valued derivative.  In other words it expresses how the normal is a parametric function of the surface equation in three variables in about as simple and precise a way as possible, in a way that only a mathematician would love.

Stephen M. Webb
Professional Free Software Developer

In addition to Bregma's explanation, you might take a look at the Wikipedia article on partial derivatives, which includes an example that (on first look at least) seems somewhat similar to the example in the book. The example in the article only uses two variables (x and y), but the principles are the same (if I'm not mistaken).

Thanks for all the help, finally understand it now. And thanks for the wiki link, I actually had no idea what those symbols were, so that helped a lot. 

This topic is closed to new replies.

Advertisement