I'm working on a verlet physics engine. A rigid body is represented by a list of verlette particles (points in 3D space), which are physically simulated realistically. Now, to draw a cube, for example, would require the position and rotation to be extracted from these points (so PositionEntity and RotateEntity can be called appropriately).
Getting the position is easy - simply calculate the average (center) position of all the points. But I can't think of a way to extract the rotation from the points. How can this be done?
Getting the position is easy - simply calculate the average (center) position of all the points. But I can't think of a way to extract the rotation from the points. How can this be done?