• Advertisement
Sign in to follow this  

3DS Rendering

This topic is 4273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I decided to use L3DS to load 3ds models. The loading code works fine. I checked that with the rendering code provided as an example with the library. But there are a few things I don't undertand. I'll provide the source for the library: l3ds.h l3ds.cpp And the drawing code:
 glTranslatef(0, 0, distance);
 glRotatef(-90, 1.0, 0.0, 0.0);
 for (uint i= 0; i<scene.GetMeshCount(); i++)
    {
        LMesh &mesh = scene.GetMesh(i);
        glVertexPointer(4, GL_FLOAT, 0, &mesh.GetVertex(0));
        glNormalPointer(GL_FLOAT, 0, &mesh.GetNormal(0));
        glColorPointer(3, GL_FLOAT, 0, &mesh.GetBinormal(0));
        glDrawElements(GL_TRIANGLES, mesh.GetTriangleCount()*3, 
                        GL_UNSIGNED_SHORT, &mesh.GetTriangle(0));
    }

L3ds load the information about material properties, texture maps... The question is... how do I stick that into the rendering function? Where do I bind the textures, apply materials and so on?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement