Results 1 to 2 of 2

Thread: changing viewpoints

  1. #1

    changing viewpoints

    Hello, I am very new to openGL, and I'm having a bit of a problem. I have this assignment to animate a ferris wheel, with the ability to look at it from a point not on the ride, as well as from the viewpoint of someone actually on the ferris wheel. I have the off-the-ride down ok, but how on earth do I get the camera to sit in one of the cars? I've tried a few things with disastrous results, using gluLookAt.

    Basically, what I need is a way to put the camera in the position of someone in one of the cars as it goes around. I also need a way to switch from that POV to off the ride.

    Can someone please help? And use small words, I'm still learning...

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2000

    Re: changing viewpoints

    Here is an idea. I dont know if it works...
    //let x0,y0,z0 - center of wheel.
    glTranslatef(x0,y0,z0)//translate to the center
    glRotatef(a,0,0,1)//rotate on a angle. Arround axis of rotation of wheel. Let it be z-axis
    glTranslatef(0,r,0)//r is wheel's radius. Now we are in the "car" on the top of wheel. (0,r,0) must be orthogonal to (0,0,1)

    glRotatef(90,0,0,1)// - adjust viewing agle so we look in the direction of movement

Similar Threads

  1. Changing states vs Changing context
    By Yossi Koren in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 10-08-2017, 01:56 PM
  2. Changing coordinates
    By Cucus in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-24-2011, 08:44 AM
  3. Changing Textures
    By Gavin in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-02-2005, 08:31 AM
  4. changing a 2d app to 3d
    By cg-hci_novice in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-01-2003, 06:29 AM
  5. Changing resolution
    By David in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-11-2000, 11:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean