this (the code you marked) only sets the initial values;
i do not use a matrix cause i scale the model before i load it to psp
so the calculation is just to resize while model is on PC
"Good artists copy, great artists steal." Pablo Picasso go2lumo.com
It doesn't keep the aspect ratio because you're normalizing the entire model into the (-1,1) cube and then scaling that with scaleX,Y,Z
So your output will have the same ratio that scaleX,Y,Z have.
your model is between [min max]
tranform it first, so the midpoint is at coordinate origin
widht pos = pos-(max+min)/2, so its between [-(min+max)/2 (min+max)/2]
now you can scale it with pos = pos*2*scale/size.. and your is in [-scale scale]
my model is already centered (done before)
i changed the code today, did not test the result, if mine fails again, ill try yours; let you know later
thanks for help
"Good artists copy, great artists steal." Pablo Picasso go2lumo.com
If you didn't already solve it, your problem seems to be, that you're scaling each aixs with it's maximum (i.e. each axis with a different value). But you should scale all axes with just one maximum. -> find the max of sizeX,sizeY and sizeZ, and scale by that one value.