Jump to content
  • Advertisement

Archived

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

Jason Z

Bicubic Bezier Normal Vector Calculation...

This topic is 5234 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 trying to implement bezier patches into my engine and have been able to calculate the heights in a uniform grid. However, when I started looking into how to calculate the normal vector at each of these points on the grid I became confused. Real Time Rendering (page 500) says that to calculate the normal vector at P(u,v) then I need to calculate the cross product as so: dP(u,v) dP(u,v) n(u,v) = ------- x ------- du dv However, each of the partial derivative equations should return a scalar value when evaluated at the point (u,v) right? So how do I do a cross product on two scalar values to produce a vector? Am I looking at this all wrong? Thanks in advance for any help you can give. Jason Z

Share this post


Link to post
Share on other sites
Advertisement
I have this in a book somewhere but I''m not sure if I could find it. Anyway, the tangent equations should return a vector. They should be similar to the equation that you use to evaluate the vertices in that they operate on the control points. So I think if you''re getting a scalar you may be misinterpreting the equations.

Share this post


Link to post
Share on other sites
P(u,v) is not the height value h(u,v) as you might have expected, but the 3D coordinate, i.e.

P(u,v) = (u, v, h(u,v)), so

dP/du (u,v) = (1, 0, dh/du (u,v)) and
dP/dv (u,v) = (0, 1, dh/dv (u,v)),

so that the cross product of them becomes

(-dh/du (u,v), -dh/dv(u,v), 1).

That''s your normal guy.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!