View Full Version : finding the UV bounding box equivalent in world space
05-19-2006, 05:20 AM
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:
I've been on this problem for awhile, so any help I can get would be greatly appreciated, and my sanity will thank you.
05-20-2006, 07:26 PM
look for the bouding box of the vertices with the same IDs as th UVs.
05-21-2006, 08:22 AM
How would I go about doing that?
05-21-2006, 04: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 + "," + $BBox + "," + $BBox + "\nTO: " +
$BBox + "," + $BBox + "," + $BBox + ".\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
05-22-2006, 07: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.
05-22-2006, 07: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.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.