Texture Coordinates

 02 February 2013 cgneuling Veteran portfolio Elisabeth Wien, Austria Texture Coordinates Hi! I have the following problem: I have vertex positions and I want to find the corresponding texture coordinats for the vertices. The documentation says the following: In order to find out which texture vertex corresponds to a mesh vertex, you have to do the following: Take the index of the mesh vertex. Find out which faces reference the index of the face. Note the number of the vertex (1 st , 2 nd or 3 rd - .x, .y or .z) inside each face. For each face referencing the vertex, get the texture face with the same index. Get the index of the respective texture vertex from the face - 1 st , 2 nd or 3 rd / .x, .y or .z The vertex you got corresonds to the mesh vertex we started with. Repeat steps 3 to 6 for all faces found. Same applies to color vertices. but I don't understand that. Can someone explain it to me a bit more understandable? Thanks a lot. share quote
 02 February 2013 denisT MAX Doctor   portfolio Denis Trofimov CA, USA do you need it for mesh or poly? .. i don't want to write a code two times.... share quote
 02 February 2013 Klunk Lord of the posts   portfolio Klunk United Kingdom this was my editable poly function for this before i started using the sdk ``````fn GeoVertToMapVert obj v mapCh = ( faces = (polyop.getFacesUsingVert obj v) as array faceIndices = for i in faces collect finditem (polyop.getFaceVerts obj i) v; makeUniqueArray (for i = 1 to faces.count collect (polyop.getMapFace obj mapCh faces[i])[faceIndices[i]]); )`````` I'm sure there are more elegant and faster solutions out there share quote
 02 February 2013 denisT MAX Doctor   portfolio Denis Trofimov CA, USA Originally Posted by denisT: do you need it for mesh or poly? .. i don't want to write a code two times.... well ... let's do it for editable_mesh trimesh: `````` fn getMapVertsUsingVert mesh vert channel:1 = if (meshop.getMapSupport mesh channel) do ( tverts = #{} for f in (meshop.getfacesusingvert mesh vert) do ( vv = getface mesh f tv = meshop.getmapface mesh channel f out = off for k=1 to 3 while not out where out = (vv[k] == vert) do append tverts tv[k] ) tverts ) `````` share quote
 02 February 2013 denisT MAX Doctor   portfolio Denis Trofimov CA, USA ... and Klunk showed it for poly share quote
 03 March 2013 cgneuling Veteran portfolio Elisabeth Wien, Austria ok thanks, nice does it matter if I have a editable poly and there a take a face with the 3 vertices and look for the texture coordinates with the editable poly method or if I convert the editable poly then and look for the texture coordinates? Does the vertices have another order when it is converted? Is there also a method to get the Texture Coordinates of a random point on a face or should I interpolate it after I have the coordinates of my vertices? share quote
 03 March 2013 denisT MAX Doctor   portfolio Denis Trofimov CA, USA i don't know what you mean by "interpolate" but to get corresponding face map point to the geo face point you have to use Bary coordinates. there is a sample in the MXS help. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.