I am attempting to write a script which is designed to determine if vertex's position lies within cylindrical area. I am using maya polyCylinders to build the area for said cylinders.
After the cylinder is moved, rotated, scaled and it's components manipulated; I need to determine if a vertex's WS position lies within this new volume. However, I do not know of a way to get a shape's exact bounding volume. Any hints or ideas?
i case of sylinder trasforma vector with teh matrix construct a line function out of that get closet point on line and measure the distance if its smaller than <X and ahas a distance form a vrector origin <Y its within the volume
I got tired of attempting to figure out formulas, so I cheated. Here's an example of my script psuedo-code
1) get bound meshes 2) get bound joints 3) get a master list of vertices in bound meshes 4) create cylinder volumes 5) create moving volume locator for each volume 6) get radius of volume and assign it to a specific attribute on locator 7) check to see if each vertex is within the range of the locator (if yes, then set vertex weight to 1 for said joint) and remove vertex from master vertex list 8) move locator a fraction of the way down the cylinder volume (based off of a calculated variable)
So that's what I came up with based off of joojaa's recommendation.
Another way is to form a curve function out of the cylinders centerline.
use the formla for closest point on curve (go to wolframs site you can find it there, as well as your high school math book as it MUST be there.) this gets you the distance to the curve, now if this distance is bigger than the cylinder readius, also that point will tell you the diatance form cylinder base if that bigger then the cylinder your in it. Maya also has anode for this called closet point on closestPointOnSurface and a closest point on curve too.