normals for a curved surface?


how do I find the normal for a surface that is curved (not necessary perfectly round curve, in my case: cross section looks like a quarter circle). Also, to draw a 2D quarter circle, how i specfiy the coordinates along the arc?

How to compute the normals depends on how you compute the curved surface itself. If you have a formula that describes the curved surface, you “only” need to find the plane that is tangent to the surface at the point where the vertex is, and from this, compute the perpendicular normal vector. Or, easier but probably with worse results, take all faces that share one specific vertex, compute all normal vectors of these faces, and take the average (which is simply adding the normals and normalizing the result).


thanx but i not very sure how to specify the curved surface also. I want to draw a surface which is a 3D quarter hollow cylinder. Can anyone guide me?

if it’s a cylinder, then the function that describes the curve probably simply is a cirle function, which is very easy (although I cannot post it from mind, but shouldn’t be a problem to find rhyming gg).


for a curved surface (1/4 of a hollow cylinder), to find the normal that is pointing outwards from the “inner” surface, where is this normal?

The normal for a point on the sides of a round cylinder is exactly the same vector as the distance between that point and the cylinder axis.

If the cylinder is going along the Z axis for example, just take the coordinates for each vertex, set Z to zero and normalize it, that is the vertex normal.

The Graphics Gems code has complete code to create vertex normals for any mesh, it even includes “fuzziness” if you want it ;o)