Home
Products
Community
Manuals
Contact
Login or Signup

re-center a mesh

BlitzMax Modules Forums/MiniB3D/re-center a mesh

ima747(Posted 1+ years ago) #1
I've got a mesh I'm loading from a file, but the mesh data isn't centered properly, can anyone recommend a way to re-center the mesh?


b32(Posted 1+ years ago) #2
If the mesh is loaded with LoadMesh, you can use:
w#=meshwidth(mesh)
h#=meshheight(mesh)
d#=meshdepth(mesh)
FitMesh mesh,-w/2.0,-h/2.0,d/2.0,w,h,d

If the object is loaded with LoadAnimMesh, things are more complicated, because it can consist of more than one mesh.


ima747(Posted 1+ years ago) #3
FITMESH! I knew I saw it somewhere before, thank you thank you!