Quote Originally Posted by chronozphere
The upper-left 3x3 matrix (from _11 to _33) is for both rotation and scaling, so:
Mat._11 = Scale_X;
Mat._22 = Scale_Y;
Mat._33 = Scale_Z;
Your code does not multiply the entire vectors, should it?

So that's almost like my second suggestion. Maybe something like this?
[pascal]
var i: integer;
...
for i:=0 to 2 do begin
mat[i,0]:=mat[i,0]*Scale_X;
mat[i,1]:=mat[i,1]*Scale_Y;
mat[i,2]:=mat[i,2]*Scale_Z;
// or test flip the other way: mat[0,i]:=mat[0,i]*Scale_X; etc...
end;
// Oh, looked up my matrix functions and this is the exact way to do it.[/pascal]
As far as i know, OpenGL and DirectX use matrices in inverse to each other so that can sometimes cause fuss too.