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

Thread: object loader

  1. #1
    Intern Newbie
    Join Date
    Jul 2004
    Location
    Bangalore
    Posts
    37

    object loader

    Hi,

    Can someone please advise me this:

    I need a 3DS loader on Linux.

    Objective:

    To create a 3D walk-through application using OpenGL (in a very short duration).

    Thanks.

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

    Re: object loader

    The "3DS loader" part has nothing to do with OpenGL.
    Personnaly, I would just outsource the job to Romania

  3. #3
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,979

    Re: object loader

    just google... everyone out there has written a 3ds loader

  4. #4
    Intern Contributor
    Join Date
    Nov 2006
    Location
    Peru
    Posts
    97

    Re: object loader

    http://lib3ds.sourceforge.net/

    Lib3dsFile* myfile = lib3ds_file_load("MySuperModel.3ds");
    Lib3dsMesh* miObjeto = lib3ds_file_mesh_by_name(myfile, "airplane");

    Mesh objects have this members:

    uint points;
    uint faces;
    uint texels//points = texels;
    Lib3dsPoint* pointL;//vertex
    Lib3dsFace* faceL;//indices

    Copy this fields to your own arrays(I don't know why it doesn't work when i send them directly to VBOs);
    If you are using VBOs:
    glBufferData(GL_ARRAY_BUFFER, 3*sizeof(float)*points, myvertexarray, GL_STATIC_DRAW);//For the veretx, for the texels just change the pointer
    glBufferData(GL_ELEMENT_ARRAY_BUFFER,3*sizeof(uint )*faces, myfacesarray,GL_STATIC_DRAW);


    Then just call glDrawElements with indices to 0.

    Bye


    If you learn how to use the keyframe part, let me know .

Posting Permissions

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