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.
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.
The “3DS loader” part has nothing to do with OpenGL.
Personnaly, I would just outsource the job to Romania
just google… everyone out there has written a 3ds 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,3sizeof(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 ;).