View Full Version : Torus Trouble - more normal problems

03-21-2000, 05:29 AM

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?

03-21-2000, 07:58 AM
-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...


03-22-2000, 07:03 AM
Save yourself the trouble and use GL's automatic normal generation.

fs http://fshana.tripod.com