3d max export plugin continued
Hi,
I just ran into some thing realy odd.
I have a cube that has 8 vertexes, 12 faces and 12 texcoords!?!?
How can it be 12? One texcoord per vertex!?!? How can I get the right uvw's for a vertex index array mesh?
Greetz J.
The standard approach is to duplicate the vertices for different text-coords on the same geometry vertex.
3DS max stores gemoetry, normals and exture coordinates in different locations, so it keeps a minimal amount of data in memory.
What you do is to look-up the texture coordinates for each face-vertex along with the geometry vertex. If you find the (uv,xyz) pair in your indexed mesh, use this index for the face vertex, otherwise create a new (uv,xyz) combination and store it in your indexed mesh.
You cannot use the arrays provided by 3dsmax directly, you will have to recombine them either by simply creating a new vertex for each face vertex or by the look-up method described above. If you need some sample code, let me know.
HTH,
Pat
3DS max stores gemoetry, normals and exture coordinates in different locations, so it keeps a minimal amount of data in memory.
What you do is to look-up the texture coordinates for each face-vertex along with the geometry vertex. If you find the (uv,xyz) pair in your indexed mesh, use this index for the face vertex, otherwise create a new (uv,xyz) combination and store it in your indexed mesh.
You cannot use the arrays provided by 3dsmax directly, you will have to recombine them either by simply creating a new vertex for each face vertex or by the look-up method described above. If you need some sample code, let me know.
HTH,
Pat
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement