Sign in to follow this  
CProgrammer

3d studio tverts

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
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[i].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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this