Extracting a rotation from 3D points

Blitz3D Forums/Blitz3D Programming/Extracting a rotation from 3D points

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

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?