Archived

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

Amma

Indexed vertices with UV map ?

Recommended Posts

Hi, I''d very much like to use indexed vertices. However, it seems that UV maps can''t be shared (well at least for most meshes). -How do you guys solve that? ----------------------------- AM

Share this post


Link to post
Share on other sites
I''m not sure what you mean exactly by a UVmap. Do you mean the texture or the coordinates? You can set the coordinates with glTexturePointer(...). And then just pass it an array with the texture coordinates (openGL will use the index array to index into this array similar to the vertexArray --> the texture array should have the same amount of points as the vertexarray (although each vertex has three values (x,y,z) and each texcoord only has two (u,v) )

Share this post


Link to post
Share on other sites
I''m talking about the UV texture coordinates.

the thing is, that although two vertices has the exact same position, normal, and color - it''s VERY unlikely that they have the same UV map. -At least according to 3DS Max.





-----------------------------
AM

Share this post


Link to post
Share on other sites
ah yes. That is a problem. I had it myself not a month ago. Check this thread, it should give you some ideas.

And the fact that this happens isn't 'VERY likely'. It's just a by-product of irregular models, that you have to split the uv-space somewhere, in order to fit a 2d plane on a 3d model (which is essentially what you are doing). I would think in an average model just under 50 % of the vertices will have multiple texcoordinates, but that is just guess from past experience making models.

[edited by - rick_appleton on August 13, 2003 8:41:26 PM]

Share this post


Link to post
Share on other sites