Archived

This topic is now archived and is closed to further replies.

texture coordinates, flexporter

This topic is 5006 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

Hi all. I''m currently working on a 3d format, and I''m using flexporter to export data from 3dsmax 5. At the current moment, I''m just copy&pasting data into my testfile.Which is built up with the structure,that my final exporter(built upon the flexporter one) will use. But I do have a problem with the texture coords. for standard exporting in flexporter I get different indices for texturecoordinates, thus in effect a vertex can have different texturecoordinates. This is a problem, since 3d api''s tend to use one index for getting all the data. I''ve tried consolidating the mesh, but it still seems to be fucked up. I''m also trying to beat a deadline for a democompo, and I need to sort this thing out asap. if anyone have had experience with flexporter and texturecoordinates, please do tell. Maybe I''ll just have to do some consolidation myself? Hoping for some quick answers

Share this post


Link to post
Share on other sites
I''m not familiar at all with flexporter, but it is not uncommon at all for a vertex in a mesh to have more than one set of texture coordinates. Such vertices occur along "seams" in the mesh, where a vertex is shared among faces that are textured from different portions of a texture. For instance, consider a model of a person wearing a shirt and jeans. Part of the mesh is skinned from a portion of the texture that contains the shirt texturing imagery, and part of the mesh is skinned from a portion that contains the jeans imagery. The vertices at the waist, where the jeans begin, must have texture coordinates for both the shirt portion and the jeans portion. Also, when wrapping a texture portion around a segment of the mesh, the edges of a texture patch are also seams, and must have multiple sets of texture coords per vertex.

If you wish to use UV texture mapping, there is really no way of getting around this. The solution is to consolidate your mesh so that there is a vertex entry in the array for every vertex with unique attributes. Consider any vertex+UV combination as a unique vertex. If a vertex has different UV coordinates than a previous vertex with the same (x,y,z), then it is to be considered a separate vertex, but merge any that have the same UV coords into one vertex.

I do all of my modelling in Blender, and wrote the exporter myself, and that is how I do it. I build my arrays of vertex structures and face indices with a unique vertex entry for every face vertex. Then, I iterate through the vertex array merging identical vertices, and modifying face vertex index values that reference a vertex that is merged to point to the newly created merged vertex.


Golem
Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller

Share this post


Link to post
Share on other sites