Goal: To have a CSG shaped tire follow the shape of an isosurface ground
during an animation.
Method:
I wrote a macro that will take the object identifier and a resolution
attribute (float value). I then create an array of points that fill the
max and min extents of the object, spacing them at the value given by
resolution. I then iterate through the list and remove all the points
outside the actual object (using the inside function).
I then place the object (and the point array) below the lowest level of the
ground (i.e. if the grounds lowest point is -.5, I place the wheel at -.6.
I then test each point in the array to determine how far I need to
translate the wheel up to get all the points outside the ground. I then
translate all the points and the wheel that amount.
I repeat the above process for each frame of the animation.
Problem:
The method is not entirely accurate.
The method is not very fast.
Question:
Is there a better way to do this?
Post a reply to this message
|