Howdy

In 3ds format every face has exactly three vertices, but because every 
vertex can be shared between two or more faces, vertices are referenced 
by their indices instead of their absolute x,y,z position.
So we have:
vector of vertices/points, in Your example:

    for(int i=0;i<vertices.size();i++)
    {
        mesh->pointL[i].pos[0] = vertices[i].x;
        mesh->pointL[i].pos[1] = vertices[i].y;
        mesh->pointL[i].pos[2] = vertices[i].z;
    }


and vector of faces, in Your example:

    for ( int j = 0; j < ( vertices.size() / 3 ); ++j )
    {
        int index = j * 3;
        mesh->faceL[j].points[0] = index;
        mesh->faceL[j].points[1] = index + 1;
        mesh->faceL[j].points[2] = index + 2;
    }

I believe that should fix problem.

PS. It looks like Your geometry doesn't use vertices sharing or maybe 
i'm wrong, i hope that this little info will help.

Greeting
Rafał Kamraj "kefrens"



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
lib3ds-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lib3ds-devel

Reply via email to