Results 1 to 5 of 5

Thread: animating movement

  1. #1
    Guest

    animating movement

    How does one animate movement between coords.

    like this:
    (only xy coords for simplicity)
    Between 0.0,0.0 and 3.0,5.0 and then from there to 6.0,-2.0

    PS. i AM incredibly clueless, so try to keep it simple DS.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    Aurora, Illinois, USA
    Posts
    192

    Re: animating movement

    I am not sure of the question, but perhaps a loop?!
    Navreet Gill [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

  3. #3
    Guest

    Re: animating movement

    I was thinking more in the ways of moving something along a 'path' but i dont know if this is possible.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: animating movement

    If I get you right, you want to specify controlpoints along your path?

    Then you can make a structure for each controlpoint, and it can look something like this:

    Code :
    struct controlpoint
    {
    	float point[3];  // controlpoint coordinates
    	float rotation[3]; // the rotation for each controlpoint
    	... and so on
    }
    You also need a timevariable called t for example. To determine between what controlpoints you are, just use a=floor(t), and you know you are between point a and a+1. Then you just interpolate between those two points using t-a as interpolation factor

    You can also use some other obscure methods to smoothly interpolate between two points, like Bezier and NURBS, cosine- and cubic interpolation.

    If you are using a the above structure with all kind of information you want, you can animate a camera (for example), specifying camerapoint, camera targetpoint, upvector, fov and whatever you like, for each controlpoint. And using a real time variable, the camera will move from on point to another in the same time independant of your framerate.

    Here are some places you can look at. http://www.flipcode.com/tpractice/issue03.shtml http://freespace.virgin.net/hugo.eli...s/m_perlin.htm

  5. #5
    Guest

    Re: animating movement

    Bob, you just made my heroes list

    Thank you !!!!!

Similar Threads

  1. help on animating a bug
    By Trevor in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-11-2008, 10:01 AM
  2. animating textures
    By bitwise in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-06-2005, 11:57 AM
  3. Animating an image
    By Nicdom in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-20-2004, 03:21 AM
  4. Animating....
    By KeSh in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-27-2004, 10:13 AM
  5. Need help in animating(scale)
    By nene in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-17-2003, 11:58 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