Thread: rotating composite objects with OpenGL

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595

    rotating composite objects with OpenGL

    I've embarked on a self-led journey into OpenGL (like many others I presume). At the moment I can work through the tutorials I have found and can do some simple stuff independently. But I'd like to do more. One thing I'd like to do is attempt to rotate a composite object. I searched the board but came up with no solutions.

    Here's a simple scenario. Say I have a bar made up of two cubes. One cube has alternating white and black faces and the other has alternating red and blue faces. Each cube has an X, Y, and Z axis and independently could spin on each axis. When connected together into a bar however the two cubes can only spin on their X axis. The question comes in if I want to animate the process of flipping the bar so the white/black cube is on the right hand side of the bar instead of the left. Is it possible to rotate the entire bar about it's Y axis (which would be the interface between the two cubes if the cubes were of the same size)? Or do you have to do the math and flip each component cube separately?

    A similar situation would arise if you were to draw a snowman's face using a sphere for the head, a cone for the nose, and two smaller spheres for the eyes. How could you animate the snowman so the whole head (face in total, nose, and eyes) all rotate together?

    A slightly more advanced scenario would be this. Say you have two bars that interlock perpendicular to each other at their middle third. Can you rotate each bar about the common midpoint independent of the other bar? If so, how do you do that, in general terms (although any detail or referrals would be gladly accepted as well).

    Thank you.
    Last edited by elad; 01-20-2003 at 10:05 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  2. Rotating In OpenGL
    By SubLogic in forum Game Programming
    Replies: 2
    Last Post: 04-05-2003, 08:56 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  4. 3D Objects In OpenGL
    By kas2002 in forum Game Programming
    Replies: 5
    Last Post: 08-06-2002, 12:15 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM