OpenGL's modelView to DirectX World matrix

Hello. I'm writing a rendering library for this application that originally uses OpenGL. I am to write an alternative DirectX renderer. So my problem is, what do I have to do to the OpenGL modelView matrix to be able to use it as the World matrix in DirectX?

This is the projection matrix setup used in OpenGL:
gluPerspective(45.0f, (GLfloat)width/(GLfloat)height, 0.1f, 100.0f);

This is my DirectX Projection matrix setup:
D3DXMatrixPerspectiveFovLH(&proj, D3DX_PI * 0.25f, width / height, 0.1f, 100.0f);

I set my View matrix to identity. I'm using the same vertex coordinates as in OpenGL, and need to (obviously) get them to transform to the same coordinates on screen. So I need to do *something* to the modelView matrix and pop it inside D3DTS_WORLD.

I've spent hours and hours trying to find this information on the net. The only semi-useful thing I've found was to multiply certain members of the modelView matrix with -1. Specifically, the following members: (0,2) (2,0) (2,1) (1,2) and (3,2). This proved correct, but only in some cases... It seems to work only if the modelView matrix is formed by a specific set of transformations. Something like one translation and one rotation. I need this to work regardless of what transformations were used, as my library doesn't get to see individual transformations, but only the resulting modelView matrix.

Alternatively, if someone can tell me (or point me to) the exact sequence of calculations OpenGL and DirectX use to transform vertex coordinates into the screen coordinate system via their respective matrices, I should be able to work it out on my own. (if you go down this route, please tell me what's on the left and what's on the right for multiplications!)

Thanks for any help!

[1811 byte] By [Eastern] at [2007-12-24]
# 1
Okay, my buddy and I have finally found the solution. For anyone who stumbles onto this problem: All you need to do is scale the modelview matrix by (1,1,-1).
Eastern at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2
can you give a fully transform maxtri for modelview.thanks!
hcl112 at 2007-10-8 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...