Question

I am trying to assemble a scene in opengl, using already made objects. The problem is that the object are in .max format and have no external textures. How could I import my objects in opengl, without retexturing them. I am thinking about exporting them to 3ds and using a 3ds file loader. Could you recommend one, and of course it has to work only with the 3ds file itself, no external texture files.


3ds max already allows me to export the file to obj. I have an object that has no external texture file, but it is already fully colored as a 3ds file. Is there any way to import in opengl and have the same colors, for the trunk, leaves?

Was it helpful?

Solution

You might want to check out lib3ds which will parse the 3ds binary format for you and give you access to all of the objects properties. I think Autodesk also has their own toolkit for doing this.

OTHER TIPS

You should look at this link. It is a 3DS viewer with source code that renders using OpenGL. The code is simple.

Another option could be Assimp, an open source asset import library for C or C++, which seems like a pretty good way to get 3DS assets into an opengl program. It'd be especially useful if you want it for skeletal animations, and supports embedded textures. Though at this point, this answer may be less for you than it is for other people coming across this question.

If I remember correctly, the 3ds file does not store the vertex normals so you will probably have to calculate them yourself somehow or otherwise it will use the normal of the face itself which is will be quite ugly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top