Results 1 to 5 of 5

Thread: OpenGL animation

  1. #1
    Guest

    OpenGL animation

    Anybody know where I could see a simple OpenGL(C++) sample code to show how aniamtion is done?
    My math is bad, I got very confused by all those curve formulas and don't how I can apply them.
    Help! It's the end of the semester, and everything is almost due(not to metion finals!)

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: OpenGL animation

    animation in what sense? obviously putting a glrotate in your draw func will gove you animation... you mean along a path or a person walking or.....

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: OpenGL animation

    Take a look at my clock example, in perspective mode is it is animated and moving.
    http://www.angelfire.com/linux/nexusone/

    Originally posted by heeeee:
    Anybody know where I could see a simple OpenGL(C++) sample code to show how aniamtion is done?
    My math is bad, I got very confused by all those curve formulas and don't how I can apply them.
    Help! It's the end of the semester, and everything is almost due(not to metion finals!)

  4. #4
    Guest

    Re: OpenGL animation

    Gavin, nexusone, thank you for your reply.my problem is to move an object along a precomputed trajectories and must have speed control. nexusone, I looked at your code, it's very cool. I noticed that you are moving the camera(lookat) to create the animation effect. So the whole scene will move. If a person is walking along a road, should I achieve the animation effect by moving the person using translate, reotate? How can I apply speed control?

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: OpenGL animation

    You can use ether gluLookAt or translate/rotate to move through your world.
    Remember OpenGL does move the camera, but the world around it to get the same effect.

    I use a timer function for speed control, also you could use a variable to set rate of movement of you person on the road.

    I would have two variables, rate and speed, being rate is how often to update object, and speed is amount of movement on each update.


    Originally posted by heeeeeee:
    Gavin, nexusone, thank you for your reply.my problem is to move an object along a precomputed trajectories and must have speed control. nexusone, I looked at your code, it's very cool. I noticed that you are moving the camera(lookat) to create the animation effect. So the whole scene will move. If a person is walking along a road, should I achieve the animation effect by moving the person using translate, reotate? How can I apply speed control?

Similar Threads

  1. Animation in Opengl
    By Srinivas Y in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-07-2015, 01:09 AM
  2. Opengl 2D animation
    By anshul in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 03-01-2010, 07:31 PM
  3. Sprite Animation / Texture Animation
    By Rodrix in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 03-11-2007, 10:36 PM
  4. about OpenGL animation
    By endo in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-13-2002, 12:48 PM
  5. Animation with OpenGL
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-29-2001, 04:08 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