Results 1 to 3 of 3

Thread: Hirarchical Animation

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    Ireland
    Posts
    5

    Hirarchical Animation

    I have to draw anything I want and am going to use an Aeroplane (very Basic) would the sad but true face be, to get this to work, to plot points on graph paper and make out the polygons myself or would there be a simpler way of doing this??
    Ger

  2. #2
    Member Contributor
    Join Date
    Dec 2001
    Posts
    91

    Re: Hirarchical Animation

    You could use a 3d modeling package to desing your plane and then use a library to load the 3d data into your application.

    Some popular programs are:
    3D Studio,
    Lightwave,
    Blender (freeware),
    Milkshape (freeware, I think).

    Good luck,
    jpummill

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2002
    Posts
    12

    Re: Hirarchical Animation

    MilkShape is not free but it has a 30 free trial, it can export your stuff to a nice text file. Theres lots of toturials on how to import the file.
    Here is a sample file from milk shape:

    Frames: 30
    Frame: 1

    Meshes: 1 //the number of meshes in our model
    "Sphere01" 1 0 //name flags, material index
    22 //number of verts in the mesh
    //flags,x,y,z,u,v,bone index, -1 no bone ascociated with mesh
    1 0.000000 0.000000 0.250000 0.000000 1.000000 -1
    ..
    ..
    ..
    1 12.216282 38.750000 0.235672 1.000000 0.333333 -1
    12 //the normals for mesh- we skip this, don't need it
    0.000000 -1.000000 0.000000
    ..
    ..
    ..
    0.168657 0.837806 -0.519264
    20 //the number of triangle
    // triangle: flags, vertex index1, vertex index2, vertex index3, normal index1,
    // normal index 2, normal index 3, smoothing group
    //you only need the 3 vertex indexes
    1 0 1 2 0 1 2 1
    ..
    ..
    ..
    1 17 21 19 11 5 1 1
    // the next mesh would come here if we had another mesh

    Materials: 1 //number of materials
    "Material01" //material name
    0.200000 0.200000 0.200000 1.000000 //ambient
    0.800000 0.800000 0.800000 1.000000 //diffuse
    0.000000 0.000000 0.000000 1.000000 //specular
    0.000000 0.000000 0.000000 1.000000 //emissive
    0.000000 //shine
    1.000000 //transparency
    ".\Fca.tga" //file name
    ""

    Bones: 0 //we can't handle bones yet

    basicly what you do is you read in the vert into an array, then the triangle into another. then this code should give you an idea of how you displace it

    glBegin(GL_TRIANGLES);
    for (i=0 to num of Triangle){
    glVertex(vertArray[triangle[i][0]]);
    glVertex(vertArray[triangle[i][1]]));
    glVertex(vertArray[triangle[i][2]]));
    }
    glEng();

Similar Threads

  1. Sprite Animation / Texture Animation
    By Rodrix in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 03-11-2007, 10:36 PM
  2. Animation
    By ctibaldi in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-05-2004, 10:35 PM
  3. How to do Animation
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-13-2003, 04:41 AM
  4. 3D animation
    By Alhek in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-20-2003, 11:09 AM
  5. Animation
    By 31337 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-15-2002, 12:35 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