Originally Posted By: pjotr987
is it DirectX-style?


No, it's neither lefthanded nor righthanded. See: the x-axis projects on the y-axis, the y-axis to the z-axis and the z-axis to the x-axis. I don't know what you are doing there... from where do you get the matrix?

This is untested code, but it basically should be your solution - it expands a 3x3 float matrix to a corresponding affine 4x4 matrix, translates it to an euler angle and rotates a bone by that.

Code:
// alread filled
float m3x3[3][3];

// expanded 3x3 matrix
float m4x4[4][4];

// expand
memset(m4x4, 0, sizeof(float) * 16);
m4x4[3][3] = 1;

// copy 3x3
int i,j;
for (i = 0; i < 3; i++)
	for (j = 0; j < 3; j++)
		m4x4[i][j] = m3x3[i][j];

// get euler angle
ANGLE angle;
ang_for_matrix(&angle, m4x4);

// rotate bone by euler angle
ent_bonerotate(my, "arm", &angle);



Maybe this can be done slicker, dunno.

[EDIT] Your matrix is a transformation, resulting from a +90° degree rotation around the (Gamestudio) z-axis followed by a -90° rotation arround the (new) y-axis. Maybe you need to do the inverse rotation (you can compute the corresponding rotation matrix beforehand) on your input data before you do things to your bones in Gamestudio's coordinate system. IMHO.

Last edited by HeelX; 07/24/12 16:04.