Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Torus Trouble - more normal problems

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Reading,England
    Posts
    4

    Torus Trouble - more normal problems

    hello,

    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?
    kev.

  2. #2
    Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    288

    Re: Torus Trouble - more normal problems

    -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...

    Dolo/\/\ightY
    Dolo/\/\ightY

  3. #3
    Intern Newbie
    Join Date
    Mar 2000
    Location
    New Jersey
    Posts
    30

    Re: Torus Trouble - more normal problems

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

    fs http://fshana.tripod.com
    Francis Shanahan
    Architect

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •