View Full Version : object loader
01-08-2008, 03:27 AM
Can someone please advise me this:
I need a 3DS loader on Linux.
To create a 3D walk-through application using OpenGL (in a very short duration).
01-08-2008, 08:15 AM
The "3DS loader" part has nothing to do with OpenGL.
Personnaly, I would just outsource the job to Romania :p
01-08-2008, 09:12 AM
just google... everyone out there has written a 3ds loader :)
Lib3dsFile* myfile = lib3ds_file_load("MySuperModel.3ds");
Lib3dsMesh* miObjeto = lib3ds_file_mesh_by_name(myfile, "airplane");
Mesh objects have this members:
uint texels//points = texels;
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.
If you learn how to use the keyframe part, let me know ;).
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.