3d studio tverts

Started by
3 comments, last by CProgrammer 19 years, 8 months ago
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
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.
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
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


Oh I see.
Ill have to look this up for maxscript since im making a maxscript exporter but I get the point. Thanks a bunch.

-CProgrammer

This topic is closed to new replies.

Advertisement