Jump to content
  • Advertisement
Sign in to follow this  
CProgrammer

3d studio tverts

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

What exactly are 3ds's tverts. The maxscript command 'gettvert $ i' will return a point3 containing the tvert. But there are usually more tverts than vertices in a mesh. Plus the difference doesnt seem to follow some linear equation. Basically I want to extract the uv's from each vertex. These are probably somewhere in the tverts. But since I dont understand tverts I cant get this to work. Any ideas? -CPogrammer

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by CProgrammer
What exactly are 3ds's tverts.


from what i remember in max c++ sdk tverts is an array of 3d texture coordinates.

Share this post


Link to post
Share on other sites
Right I think so too. But why are there not the same number as vertices? Sometimes there are more and sometimes less.
Is there perhaps another array that assigns them to vertices? If so what?

-CProgrammer

Share this post


Link to post
Share on other sites
Max is trying to be 'efficient' by having the minimum number of actual geometry verts. Think about how triangles in a mesh share edges (and thus verts). In some extreme cases, you might want to have a unique texture mapping on each triangle. Rather than duplicate geo verts, Max's solution is to have a separate array of texture faces, one for each geometry face. Each texture face has 3 indices into a texture vert list (which could be, and often is, larger than the geo vert list). You get at them like this:

for some face i in a Max mesh, get the index into the tvert list:
long tVertIndex = mesh->tvFace.getTVert[j], where j is 0, 1, or 2

get a ptr to the tvert:
UVVert *tvert = mesh->getTVertPtr (tVertIndex);

Complicated enough? There is yet another way to get at the tvert if you are using multiple mapping channels, but let's skip that for now.

joe
image space


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!