# DirectX vs OpenGL matrix math?

Hi,

I have these lines of OpenGL code, that I need to port to DirectX. I have no choice in doing this or not. So, could anybody help me out with what the DirectX code would look like for the case below?

double gl_vector;

// R is a rotation matrix, right-hand coordinate system, column major. T is the translation vector (x, y, z).

gl_vector[04+0] = R; gl_vector[04+1] = R; gl_vector[04+2] = R; gl_vector[04+3] = 0.;
gl_vector[14+0] = R; gl_vector[14+1] = R; gl_vector[14+2] = R; gl_vector[14+3] = 0.;
gl_vector[24+0] = R; gl_vector[24+1] = R; gl_vector[24+2] = R; gl_vector[24+3] = 0.;
gl_vector[34+0] = T; gl_vector[34+1] = T; gl_vector[34+2] = T; gl_vector[34+3] = 1.;

## glMatrixMode(GL_MODELVIEW); glLoadMatrixd(gl_vector); glEnable(GL_DEPTH_TEST); glClear(GL_DEPTH_BUFFER_BIT); glutSolidTeapot(100);

How can I take the exact same values of R and T and position an object in (left-handed) DirectX at the proper/same location as in OpenGL?

R and T are given to me by an external tool (like a mechanical arm), so I can’t control how they are calculated. I just have the values.

Thanks a lot 