the trick i worked out was kind of like this, it may or may not help, but it allows you to scale using blitz units rather than percent/100, so you can fit your model into a 'box' say 100x200x50: Note, this may not work so well if the animated mesh expands with animation (not tested) but works great for normal animated models.
;--------------------------------------------------------------------------------
;loads and scales an animmesh
;--------------------------------------------------------------------------------
Function loadscaledanimmesh(filename$, sx#,sy#,sz#) ;Size in blitz units not percent!!
;By Dan @ D-Grafix
;useage : mesh=loadscaledanimmesh(file$,width,height,depth)
;create scaler and mesure static mesh
scaler=LoadMesh(filename)
mesh_SX# =MeshWidth(scaler)
mesh_SY# =MeshHeight(scaler)
mesh_SZ# =MeshDepth(scaler)
;load 'real' mesh
mesh=LoadAnimMesh(filename)
;do some maths
Xscale# = ((100/mesh_SX) * sx) / 100.0
Yscale# = ((100/mesh_SY) * sy) / 100.0
Zscale# = ((100/mesh_SZ) * sz) / 100.0
;scale meshes
ScaleEntity mesh,Xscale#,Yscale#,Zscale#
;and bin tempmesh
FreeEntity scaler
;return it
Return mesh
End Function
You can modify this to center the mesh by adding an extra parent pivot and moving it to an offset of the meshs parent pos.
What exactly do you need it for, if you have to change the scale of individual children's physical mesh, this gets a lot harder as you will have to adjust the internal transformation matrix(see online manual)
|