center pivots to objects

Blitz3D Forums/Blitz3D Programming/center pivots to objects

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Depends on what meshes you are loading. For a .X or .3DS you can use VertexX, VertexY, VertexZ on every vertex. Usually I try to find the maximum/minimum X/Y/Z coordinates. The middle point is the average: (max+min)/2. I never used .B3D, so there might be another way to get its centre position. However, I think it is easiest to create the model around 0, 0, 0 in the editor.
(edit)
If I'm correct, models allways rotate around their own (0, 0, 0). In world coordinates that is EntityX(mesh, 1), EntityY(mesh, 1), EntityZ(mesh, 1). Or TFormPoint 0, 0, 0, mesh, 0->then read TFormedX/Y/Z()