|
|
So there's this thing I want to do, simulating self-assembly of a few
dozen parts. The idea is that each part has a small number of nodes
that are attracted to corresponding nodes on other parts.
To find its proper place, a part will generally have to be both
translated and rotated. Translation is easy: for each node there's a
vector to its mate, and the part moves on each step by some fraction
(probably half) of the average of these vectors.
Rotation is where I'm stuck. The obvious metaphor is torque: cross that
node-to-node translation vector with the center-to-node vector, and you
get a torque vector, and all the torque vectors for each part can be
averaged together ...
But wait, I don't want to give the part some angular momentum, I want it
to *step* by the needed rotation. I want a function that translates
(pardon the pun) the sum of these pseudo-torque vectors into a rotation
matrix -- and I never did study 3D rotation matrices.
So, have you done anything similar?
--
*\\* Anton Sherwood *\\* www.bendwavy.org
Post a reply to this message
|
|