Pivot Point centering

Blitz3D Forums/Blitz3D Programming/Pivot Point centering

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.

You take the width,height and depth of the entity. You centre the entity around the 0,0,0 axis. You do this by using the fitmesh command:

FitMesh mesh,-(0.5*meshwidth(mesh)),-(0.5*meshheight(mesh)),-(0.5*meshdepth(mesh)),meshwidth(mesh),meshheight(mesh),meshdepth(mesh)

Your mesh should now be centred around the 0,0,0 axis. Now, simple Positionentity, or if you want to move the vertices instead, moveentity to your pivot point.