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 2 of 2

Thread: How do you make a Cylinder??

  1. #1
    Guest

    How do you make a Cylinder??

    I need to make a cylinder does anyone
    have any ideas??

    thanks

    Greg

  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Italy
    Posts
    126

    Re: How do you make a Cylinder??

    Two ways:
    - using glut (quadrics)
    - doing math

    You can do the two circles with a triangle fan, describing the points on the xz plane in this way:
    x=ray*cos(theta)
    z=ray*sin(theta)
    where theta is (current slice)*360/(number of slices).
    The y coord depends by the height and the 'offset' form the origin.
    The side faces can be done with quad or tri strips using the points already calculated.
    The normals... well there you need more math.
    bye!
    tFz

Posting Permissions

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