positioning entities

Blitz3D Forums/Blitz3D Beginners Area/positioning entities

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.

try using my scale animmesh fuction:

get it here:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1430
It allows you to scale an anim mesh using the actual 3dunit system rather than a scale factor. So the mesh will always be (for example 1x2x1 3d units)


Also, ive got darkmatter too, the root axis (or pivot point, hotspot or whatever it gets called these days) of the mesh is at the feet, so you need to place a pivot in the center if you want a collision radius to work.

Something like
   ;create our (real) hero
   hero=createpivot()


   ;load the visible part of the hero
   herosbody=loadscaledanimmesh("yourmesh.b3d",2,2,2)

   ;atatch it to the pivot
   entityparent herosbody,hero

  ;then move the body down do piv is in the middle
   moveentity herosbody,0,-1,0

   ;then if collisions are needed apply it to the pivot.
   entityradius hero,2,2 
   entitytype hero,type__hero



Now all you need to do is position & rotate the pivot rather than the mesh, and its reference point will be central :)