View Full Version : finding the UV bounding box equivalent in world space

 neonoodle05 May 2006, 04:20 AMHi everyone. I'm trying to find the bounding box equivalent of UV space in world space. So if I have a cylinder with 12 subdivisions, I can get the coordinates of each vertice of the face in world-space and UV space, but given those coordinates, how can I get the world-space coordinates of the UVs bounding box coordinates? Here's an image to demonstrate what I mean: http://i30.photobucket.com/albums/c304/neonoodle5/boundingBox.gif I've been on this problem for awhile, so any help I can get would be greatly appreciated, and my sanity will thank you.
ephemeros
05 May 2006, 06:26 PM
look for the bouding box of the vertices with the same IDs as th UVs.

neonoodle
05 May 2006, 07:22 AM
How would I go about doing that?

Segmoria
05 May 2006, 03:25 PM
From what I understood the following script should do your job:
{
string \$selectedFace[] = `ls -sl`; //get selected faces
PolySelectConvert 4; //convert selected faces to UVs
polySelectBorderShell 0; //convert to UV shell
string \$UVinSet[] = `ls -sl`; //get selected UVs
float \$BBox[] = `exactWorldBoundingBox (\$UVinSet)`; //get world bounding box coordinates

print("Current UV Shell Bounding Box\nFROM:" +
\$BBox[0] + "," + \$BBox[1] + "," + \$BBox[2] + "\nTO: " +
\$BBox[3] + "," + \$BBox[4] + "," + \$BBox[5] + ".\n");
}
Just select a face, and it will print out the world coordinates of the current UVshell's bounding box.
Hope this is what you were looking for

neonoodle
05 May 2006, 06:28 PM
Thanks for the reply Segmoria. The thing is that exactWorldBoundingBox gives back a 3d cube for the bounding box. I'm looking for the equivalent bounding plane with the proper orientation to the UV space coordinates as well. Right now, I'm getting the cross product of 2 vectors on the real-world plane so that I could find the vector that defines the plane, then running the UV coordinates off of a projection matrix found at the bottom of this (http://www.euclideanspace.com/maths/geometry/elements/plane/index.htm) page. But the resulting points are completely off in terms of scale. So, I'm kinda stuck on where to go from there.

CGTalk Moderation
05 May 2006, 06:28 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.

1