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: Bending Cylinders

  1. #1
    Intern Newbie
    Join Date
    Mar 2001
    Posts
    48

    Bending Cylinders

    I am trying to create a cylinder that is 1 unit in length and from one end to the other it bends. For example the Open GL pipes screen saver that comes with windows. Each of the elbows look like a cylinder but the center of the cylinder curves to form a rounded transition from going one direction to the next.

    Thanks for any help you can give me.

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    186

    Re: Bending Cylinders

    a quick and dirty solution would involve a funtion f(x) representing the "core" of the cylinder. then , traverse the line(function) and draw concentric circles around it, spacing them out by some delta-x. the smaller your delta-x, the smoother the cylinder will be.

    b

  3. #3
    Intern Newbie
    Join Date
    Mar 2001
    Posts
    48

    Re: Bending Cylinders

    Coredump

    Thanks for the quick and dirty algortim, but for what I want it to do may be too slow at run time. I am looking into making a Open GL Roller Coster Screen Saver but with the hills and curves in the track it will need to have prolly too many of these spheres to make it look like the track is solid and not made up of spheres.

    I may be looking into defining a partial Torus to implement these curves.

    In theory it should work.

Posting Permissions

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