PDA

View Full Version : calculating normals for lighting



phanie
05-10-2001, 07:42 AM
hello

i want to light a shape, for example a cone, composed by several polygons.
i have (almost) no problems for calculating the normals of the curve part of the cone : at each vertex, i calculate its normal by averaging the adjoining facets normals.
but if i do the same with the the plane part of the cone,
i have a non-realistic effect.
on the other hand, if i define a normal for each facets, i loose the smooth aspect.

what can i do ?

thanks ; )

Boresight
05-10-2001, 09:21 AM
For the plane or base of the cone the normals pointing to negative y axis (if the sharp part is pointing to positive y axis), the normals on the edge too, no averaging with the rounded part.

Korval
05-10-2001, 12:20 PM
Basically, you're going to have two sets of normals for the points around the flat parts. One set of normals will be used with the round part, the other set will be used with the flat part.

This means that you will have to replicate the vertex position in your vertex array (if you are using one, that is).