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 8 of 8

Thread: Display a complex mesh in openGL

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    4

    Display a complex mesh in openGL

    Until now I have been able to render cubes or 2D triangles, now I want to draw a real model (next step will be bones animation). I'll use my own binary file format, but still need to choose an intermediate export format for my tool (3DSmax or Blender)

    Collada is widely supported, but seems really hard to understand, preprocess and then import. For example it doesn't seem to support shared vertices, so I should go through the primitives and find them on my own. Moreover, it seems that Blender's Collada exporter doesn't use triangles

    Do you have any suggestion? For code reuse, the file format should support bones animation

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Display a complex mesh in openGL

    I found .obj (wavefront) quite nice to start, as it is easy to understand and widely supported. But no bones suppport.

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: Display a complex mesh in openGL

    The .x file format supports meshs and skeletal animation. Blender can export them however I have never tried so I don't know if their script code is complete.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    4

    Re: Display a complex mesh in openGL

    Unfortunately obj doesn't support skeletal animation, so sooner or later it won't suit my needs

    direct x files are hard to work with in non-windows environments.

    I believed that Collada was straightforward to use, but actually it's quite complex and each modeler has its own export "style", so it's a real mess. I'm a true beginner in openGL and graphics programming in general, so my primary purpose is to learn graphics stuffs and not wasting my time with general programming problems

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    4

    Re: Display a complex mesh in openGL

    Further information.
    Do you waste too much memory if you draw without indices array? I ask this because it seems that Collada doesn't supports vertex reuse. It doesn't address the vertices with an index, but rather uses a tuple [position, texcoord, normal, ...]

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Posts
    573

    Re: Display a complex mesh in openGL

    COLLADA would be ideal just use their parser and it should be very easy.

  7. #7
    Junior Member Regular Contributor
    Join Date
    Jan 2011
    Location
    Paris, France
    Posts
    233

    Re: Display a complex mesh in openGL

    The .MD2 file format is a good format for to begin
    http://tfc.duke.free.fr/old/models/md2.htm

    After, we can see at .MD[3,4,5] Doom/Quake file formats if you want sophisticated squeletal animations
    @+
    Yannoo

  8. #8
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    4

    Re: Display a complex mesh in openGL

    Thanks for your replies. I'm trying with Collada right now, hope this works

Posting Permissions

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