Results 1 to 4 of 4

Thread: Rotation Animation question.

  1. #1
    Senior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    macedon, ny
    Posts
    288

    Rotation Animation question.

    Im not sure if this is possible or not, but maybe. Is it possible to rotate only 'certain' verts of an object.

    Say I have a model of a person, and i want to make him walk. (Key Frame Animations).

    I have the model, and i have an index of what verts belong to what bones. So I would like to be able to rotate those verts around said bone joint (a vert in space)

    So would i be able to only rotate certain verts from my vertex array around this joint??
    Something like this if the functions existed.

    glPushMatrix();
    glRotate(Verts with index # 3)
    glVertexPointer(3, GL_FLOAT, 0, VertArray);
    glPopMatrix();

    Now i KNOW, that this cant be done this way, but it always helps to have a visual. Anyone know how this could be done. Im simply trying to create a key frame animation set, with out having to use more than one model per object, or having to change the vert data directly. Thank you.

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

    Re: Rotation Animation question.

    I am not sure that you can do it within a array of verts.
    but what you can do it make each moving part a subpart of the whole object.

    //object
    glPushMatrix();
    glTranslatef(....); location of object
    glRotatef(....); rotate of whole object

    // move head
    glPushMatrix();
    glTranslatef(...); location of head
    glRotatef(....); Rotation of head
    draw_head();
    glPopMatrix();

    // repeat for other moving parts.

    glPopMatrix(); // end of object;

    The other why to handle object animation is to have complete object's with diffrent poses.

    example

    My_robot.vert_arry[0]; Standing
    My_robot.vert_arry[1]; Raising left foot
    My_robot.vert_arry[2]; Raising Right foot
    My_robot.vert_arry[3]; Pointing gun.
    etc.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    macedon, ny
    Posts
    288

    Re: Rotation Animation question.

    Well crap, there REALY should be a way to access indidual (indexed) verts within an array. That would make Key Frame animation, REALY fast, NO proccessor involvment, and the actual data would never need to change. I wonder why its never be implemented. Anyone have any other suggestions.

    Thanks.

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

    Re: Rotation Animation question.

    I reality the reason is that even if you could change verts in an array. You still have to process the whole array again anyway due to the change.
    So there is no speed gain in a changing one vertex in a array vs. using a new array all together.

    And I think that I covered the most popular ways of doing animation.

    Look at how doom or quake editors work, this will give you some ideas on animation that is used in games


    Originally posted by dabeav:
    Well crap, there REALY should be a way to access indidual (indexed) verts within an array. That would make Key Frame animation, REALY fast, NO proccessor involvment, and the actual data would never need to change. I wonder why its never be implemented. Anyone have any other suggestions.

    Thanks.

Similar Threads

  1. Some question on animation
    By inegvey in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 09-06-2016, 01:54 PM
  2. Replies: 2
    Last Post: 08-03-2013, 01:45 PM
  3. Rotation animation stopped less than 360 degree
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-10-2005, 10:40 PM
  4. Question about .3ds animation
    By fiendish_friend in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-28-2003, 01:25 AM
  5. 3D animation question
    By napalm21 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-12-2002, 08:03 PM

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