Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Hey all, i'm currently using Lib3ds to load models into my C++/OpenGL project. So far, i've been follow the model loading tutorial found here.

The tutorial gives a good example of how to draw the vertices and normals using VBO's, but so far i've been lost as how to do the same thing with materials.

Could i get an explanation/example of how to both load and draw materials of my meshes using Lib3ds and OpenGL?

share|improve this question

1 Answer 1

Explanation: every mesh face has a material, basically you need to load each material and during rendering:

for each mesh do
   for each face do
      setup face material
      draw face
   end
end

But this will be inefficient and the ideal would be to group faces by material. You can after load process the mesh and group the faces with the same material, then you can draw each face batch at once for each material.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.