Torus Trouble - more normal problems


i have some code which draws a torus (or n degrees of it) by basically sweeping a circle around another one and joining up the sections as i go along.

right… i need to calculate the vertex normals but i dont want to have to do it based on an average of face normals or anything like that. i know that if you have a sphere the vertex normal at any point is simply the same as the vertex itself ( if the middle of the sphere is at the origin) so i just want to know if there is a clever little trick i can use to calculate the normal at a particular vertex on a torus (drawn with the middle of the torus at the origin).

any ideas?

-primary circle: represents the path for the…
-secondary circle, wich rotates around.

the normal to the vertex you are calculating can be easily obtained from the secondary circle.

trace a ray from the secondary circle center (wich lies on th “path”) to a vertex on the secondary circle (your torus vertex) and normalize.

this should work…


Save yourself the trouble and use GL’s automatic normal generation.