positioning entities

Blitz3D Forums/Blitz3D Beginners Area/positioning entities

Gord(Posted 2006) [#1]
I have some 3d animated characters in 3ds format. I got them from a prog called Dark Matters.When I position them they never appear in my level. I use the x y z coords printed on the screen to assist in placing them.Is this none appearance cos they are too small to see?


Shambler(Posted 2006) [#2]
Either that or they are too big, try scaling them.


D4NM4N(Posted 2006) [#3]
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 :)


puki(Posted 2006) [#4]
I find it easier to just load a mesh and have a camera offset from it and then PointEntity cam,entity - then I know that the entity is in the right position for me to attempt scaling it up or down. Once you have the scale then you can ditch the PointEntity cam,entity and load the entity at any position (knowing the scale is right).