• ### What is your GameDev Story?

#### Archived

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

# Bicubic Bezier Normal Vector Calculation...

This topic is 5354 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
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 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 on other sites
Lutz,

Thanks a bunch, that cleared it up.

Jason Z

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634060
• Total Posts
3015300
×