Why is Matrix.MutiplyMV rotating vectors clockwise?
===

    	
I am baffled as to why android's matrix class's multiplyMV method seems to be rotating my vector coordinate clockwise, when I thought it would be counter-clockwise.

In this code pos is the vector coordinate and set to be **<0.0f, 5.0f ,0.0f>**, and the matrix will rotate the coordinate vector by -45 degrees about the Z axis. I would expect the result vector coordinate in the <+,+> quadrant, namely **<3.535534, 3.535534>**. But instead, it rotates the coordinate in the opposite direction, <-,+> quadrant, namely **<-3.535534, 3.535534>**.

	Matrix4 mtxRot = Matrix4.InitRotateEulerXYZ(0.0f, 0.0f, -45f);
	pos.Set(0.0f, 5.0f ,0.0f);
	mtxRot.TransformCoordVec(pos);

 
Here's my in Matrix4.InitRotateEulerXYZ

	public static Matrix4 InitRotateEulerXYZ(float x, float y, float z)
	{
		Matrix4 rotMatrix = new Matrix4();
		
		/*  XYZ = | cz*cy,   sz*cx + cz*sy*sx,  sz*sx - cz*sy*cx |
			      | -sz*cy,  cz*cx - sz*sy*sx,  cz*sx + sz*sy*cx |
			      | sy,     -cy*sx,             cy*cx            |  */
		
	    // Convert from degrees to radians
	    x = MathHelper.DegreesToRadians(x);
	    y = MathHelper.DegreesToRadians(y);
	    z = MathHelper.DegreesToRadians(z);
		
	    rotMatrix.GetArray()[0] =  MathHelper.Cos(z) * MathHelper.Cos(y);
	    rotMatrix.GetArray()[1] = -MathHelper.Sin(z) * MathHelper.Cos(y);
	    rotMatrix.GetArray()[2] =  MathHelper.Sin(y);
		
	    rotMatrix.GetArray()[4] =  (MathHelper.Sin(z) * MathHelper.Cos(x)) + (MathHelper.Cos(z) * MathHelper.Sin(y) * MathHelper.Sin(x));
	    rotMatrix.GetArray()[5] =  (MathHelper.Cos(z) * MathHelper.Cos(x)) - (MathHelper.Sin(z) * MathHelper.Sin(y) * MathHelper.Sin(x));
	    rotMatrix.GetArray()[6] = -(MathHelper.Cos(y) * MathHelper.Sin(x));
		
	    rotMatrix.GetArray()[8 ] = (MathHelper.Sin(z) * MathHelper.Sin(x)) - (MathHelper.Cos(z) * MathHelper.Sin(y) * MathHelper.Cos(x));
	    rotMatrix.GetArray()[9 ] = (MathHelper.Cos(z) * MathHelper.Sin(x)) + (MathHelper.Sin(z) * MathHelper.Sin(y) * MathHelper.Cos(x));
	    rotMatrix.GetArray()[10] =  MathHelper.Cos(y) * MathHelper.Cos(x);
	    
	    return rotMatrix;
	}

And here is my Matrix4.TransformCoordVec method

	public Vector3 TransformCoordVec(Vector3 vec3)
	{
		Matrix4.inVec[0] = vec3.X;
		Matrix4.inVec[1] = vec3.Y;
		Matrix4.inVec[2] = vec3.Z;
		Matrix4.inVec[3] = 1.0f; // homogeneousCoord
		
		Matrix.multiplyMV(Matrix4.outVec, 0, this.matrix, 0, Matrix4.inVec, 0);		
		
		vec3.X = Matrix4.outVec[0]; vec3.Y = Matrix4.outVec[1]; vec3.Z = Matrix4.outVec[2];		
		return vec3;
	}

Any help is greatly appreciated!