Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 23

Thread: Need help for animation

Hybrid View

  1. #1
    Junior Member Regular Contributor
    Join Date
    Jun 2010
    Posts
    162

    Need help for animation

    I have somehow managed to find out the medial axis path of my tubular intestine model. Now I want to create animation so that the camera moves from the start of the medial path to the end of it. The path is a set of points. Could somebody give me some guideline about constantly moving from one medial axis point to another to create animation? Thanks.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099
    A one second Google search immediately brought me to this exhaustive paper. You may also check out various books on computer animation, my reference being Computer Animation by Rick Parent. Also, for an essential tool regarding this topic, i.e. arc-length parameterization, you may check this paper out. Knowing arc lengths of motion curve segments helps you keep the camera speed constant while moving along a curve with differently spaced control points.
    Last edited by thokra; 01-11-2013 at 01:42 AM.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2010
    Posts
    162
    Thanks for the paper which is quite exhausetive. I think my work is much simpler as I already have the points along which the camera will traverse. I would like to proceed step by step. I place the camera at the beginning of the tube i.e. beginning point. I think I just need to place the camera from previous to the next point. Do I need to consider anything more?As I have never worked on camera manipulation, I need some more input to work on it. I think I only need to deal with gluLookAt function and camera position i.e. cameraX, cameraY, cameraZ. In the following equation,

    gluLookAt( cameraX, cameraY, cameraZ, centerX, centerY, centerZ, upX, upY, upZ);

    Do I need to consider other gluLookAt parameters?

    Please help me clarify it.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,101
    gluLooatAt will work find but you have to conside how smoothly you want to move the camera (ie how far you move the camera along your path in a second) and what you do when you reach a corner.

    As you a approach a corner you have 3 options -

    you center can remain along the vector you are currently travelling and you jerk around the corner as you swap vectors when the camera reaches the cornder - this is the easiest to do

    you stop the camera at the corner and smoothly rotate the center around the corner vertex to the new align along the new vector before continusing along the new vector

    you have your center go around the corner onto the new vector before the camera has arrived at the corner - this may look better but you have to consider how far ahead of the camera the center is so you don't try to look through the wall of the intestine.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Jun 2010
    Posts
    162
    Suppose I have first two points in my path: v1 and v2. I set camera at v1 and center at v2. Next point is v3. I put camera at v2 and center at v3. Now do I need to check everytime the alignment between vector v1v2 and v2v3 before moving the camera? Please clarify a bit.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,101
    What you are describing is not a true animation you need to move the camera along the path; the path is not discret points but a continuous function. If your camera has a velocity of v then your camera will travel d = vt in time t. If you camera is at point p on the path your camera need to be placed at the point d units along the path from p. Note this new position need not be exactly at a vertex defining the path (in fact it almost certainly won't be). To understand how to do this you need some basic understanding of vectors. What background do you have on vector maths?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •