View Full Version : Volume select script?

07 July 2002, 05:43 PM
Im no proggramer, so be gentle

Im trying to set up a vehicle rig. The problem is i cant seem to find a way to setup an object level colission detection.
I have a scripting idea, but i need to know if its possible and if so what the 'syntax' (terminogy) would be.

A background on the proposed rig:
The wheel is child of 'Axel'
Axel is child of 'Floor-Hight'
Floor hight is Position Constrained to 'Strut'
Strut is a child of the vehicle body.

These are all just names, they could be anything from geomtry to null to implicit, whatever works. (Asside from the wheel and the vehicle body which would of course be geometry)

Now if XSI had a form of collision detection asside from soft-bodies, this would be easy. The floor hight would be offset at full spring extension and the collision would push it back toward the 'Strut'.

Softbodies work well for mesh deformations, but are virtually useless when it comes to rig control, the results do not effect the center of the object.

So enter the script. Ill add another object to the hirarchy, a shpere called 'Volume'. Constrain the sphere to 'Floor-hight', so that it follows the 'Floor-hight'.

I want the 'Volume' sphere to select a group of points based on whether or not they existed inside of the sphere, within its volume. It would tag those through whatever means work (clusters, groups...?). We'll use a cluster with a center for this example. After the wheel passed the area it would have to delete the cluster and select a new set. This would define an average y position for the area just around the tire. And that y position could be used to define the 'Floor-hight'

The result.
(Floor-hight constraint offset is '5' units below the Strut, the Struts would usually ride at about 3.5 to 4 units above the ground
The ground will be called terrain and in this case will just be flat and centered at 0, so all average point centers will be zero as well)
Body rolls back in an ecceleration...
The front struts raise to 6 units y pos.
They pull the floor-hight 1 unit off the ground.
The volume sphere is determining the average point center position of the terrain.
The floor hight checks the Volume shpere to make sure it is above the average point center-pass.
(The front wheels lift at full spring extension)
The Rear struts drop to full spring compression, lets say 3.5 units.
The floor-hight is pushed down by the constaint, attempting to reach -1.5 units in y.
The volume sphere is determining the average point center position.
The floor hight checks the Volume shpere to make sure it is above the average point center of the terrain-Fail.
The Floor-hight is kept equall to the Average point pos.y
(The rear of the car sinks into its suspension.

I know how to write all of this after some exercises building a leg rig, the floor-hight part and the actuall collision detection. What i dont know is how to determine what it collides with.
How can i create clusters based on the volume of an intersecting sphere. I need a 'Volume Selection Script'.

D$%# this is a long message, hope no-one minds.
Thanks in advance...

P.S. Writing this has inspired me to do some experiments with boolean operations, specifically the word 'intersecting'. But please any thoughts would be greatly appriciated.

CGTalk Moderation
01 January 2006, 12:00 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.