On Wednesday 10 October 2007 05:22, Jim Langston wrote:
> I have a list of triangles that make an object. In my case they are
parts
> of a model, torso, head, right upper arm, right lower arm, right hand,
> left upper leg, left lower leg, left foot, etc...
>
> I want to be able to animate the points of the model. I've written a
> program that I use for a user to identify which triangles are in which
> body parts. Now programically I'd like to identify the connecting
> points in some method. This is so once the triangles lists are
> created the program can create pivot points and such.
....
> The simplest method and one that would work for 8 out of the 14 parts is
> cylinders, which would be the upper/lower arm, upper/lower legs.
You might start with a bounding box. There are lots of good
algorithms to find the smallest box surrounding a cloud of points.
Or you could find the least squares fit line, which would be the long
axis, rotate so the axis is straight along X (or Y or Z), then find a
bounding box. That box is a good approximation to your cylinder.
-paul-


|