PDA

View Full Version : select face at specific UV cordinate


vytautas
03-24-2007, 08:03 PM
Hello,

Can anyone tell me please how to select polygon Face if i have UVmap coordinate like u 0.245 and v 0.587
there is no uv point like
pCylinder1.map[44] ;

i have only U and V parameters,

and if the uv is on the edge so i need all faces that are sharing this uvMap coordinate

or just main faceindex that is in this UVmap coordinate

Thank you.

vytautas
03-25-2007, 06:26 AM
anybody got tan idea??

i have a point u 0.215 and v 0.546 (JUST SIMPLE NUMBERS NOT UV POINTS) and i what to select a face that has this map coordinate.

maybye there is some comand?


Thank you

purga
03-25-2007, 08:01 PM
I am not sure you can do it reversely, so seems the easiest dierect way is to traverse all the UVs and find it.

$u_given = (given data);
$v_given = (given data);

proc float[] get_uv_index( float $u, float $v, int $total_vertices_count ) {
for ( $i in ($total_vertices_count) ) {
$m = (vertex.map[$i].uv) ;
if ($m[0] == $u) && ($m[1] == $v)
return $m;
}
}

get_uv_index($u_given , $v_given, 346);
Hope this helps.

CGTalk Moderation
03-25-2007, 08:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.