Skip to main content
gamedev.net
🔒 Locked

3DS Rendering

Started by Devil_Inside 0 replies 700+ views
Original Post
Devil_Inside
Devil_Inside
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?
================= No Brain - No Pain =================

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.