Hello,

im new to lib3ds but need to export geometries into the 3ds-format. I
wasn't able to find any information  that
would help me to understand how 3ds works. Like what nodes,meshes,faces
actually are and how they have to be defined.

I did something like:
    Lib3dsFile* file =lib3ds_file_new();
    Lib3dsMesh* mesh=lib3ds_mesh_new("the_mesh");
    lib3ds_mesh_new_point_list(mesh,(Lib3dsDword)vertices.size());
    lib3ds_mesh_new_face_list(mesh,(Lib3dsDword)(vertices.size()-3));
  
    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;
    }
    for (int j=0;j<vertices.size()-3;j++)
    {
        mesh->faceL[j].points[0]=vertices[j].x;
        mesh->faceL[j].points[1]=vertices[j+1].y;
        mesh->faceL[j].points[2]=vertices[j+2].z;
    }

    lib3ds_file_insert_mesh(file,mesh);
    std::string* filename = new string("C:/test.3ds");
    lib3ds_file_save(file,filename->c_str());

It writes an 3ds-file but  sketchup wasn't able to load it (some error
about incorrect vertexindices).
The API-documentation of lib3ds isn't that helpfull either, so where
would i look to find that information?

Thanks, Johannes

-------------------------------------------------------------------------
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