The z value of a vertice defines the value used within the Z-Buffer, where 1.0f is as close to the camera as possible and 0.0f is as far away as possible. The RHW is typically calculated as 1.0f / z_dist_from_origin (origin is the camera position which in my case always remains 0,0,0)
For some reason, the original D3D renderer defines a value _ZSCALE as -16.0f and then divides it by the vertices z value, then the RHW value is processed where _AZSCALE is equal to 1.0f / 16.0f and RHW is equal to z * _AZSCALE
Also, by default Direct3D's co-ordinate origin is at the top-left of the window and you simply pass the width of the window as a float to a vertex and the vertex will be placed on the right hand side of the window, where as in OpenGl the origin is in the center of the window space, and a value of 1.0f for the x axis will place the vertex on the right side of the window, a value of -1.0f will place it on the left side of the window. For y it's the same, 1.0f will put the y position on the top side of the window and -1.0f will put it on the bottom side.
I'll post some of the data I dumped during a test of mine. I have to work with this data that I have without manipulating it too much ( I can modify it if absolutely necessary but I'd prefer not to)
ev0: 438.974976,371.207733,-19070.726563ev1: 438.974976,371.207733,-19070.726563ev2: 438.974976,371.207733,-18559.201172ev0: 438.974976,371.207733,-19070.726563ev1: 438.974976,371.207733,-18559.201172ev2: 438.974976,371.207733,-18558.964844ev0: 456.157349,371.207733,-19070.726563ev1: 456.157349,371.207733,-19070.726563ev2: 456.157349,371.207733,-18559.201172ev0: 456.157349,371.207733,-19070.726563ev1: 456.157349,371.207733,-18559.201172ev2: 456.157349,371.207733,-18559.201172ev0: 559.253235,364.763855,-19070.019531ev1: 559.253235,364.763855,-19069.783203ev2: 559.253235,364.763855,-18558.257813ev0: 559.253235,364.763855,-19070.019531ev1: 559.253235,364.763855,-18558.257813ev2: 559.253235,364.763855,-18558.494141ev0: 473.339691,371.207733,-19070.726563ev1: 473.339691,371.207733,-19070.726563ev2: 473.339691,371.207733,-18559.201172ev0: 473.339691,371.207733,-19070.726563ev1: 473.339691,371.207733,-18559.201172ev2: 473.339691,371.207733,-18559.201172ev0: 542.069885,366.911865,-19070.253906ev1: 542.069885,366.911865,-19070.019531ev2: 542.069885,366.911865,-18558.494141ev0: 542.069885,366.911865,-19070.253906ev1: 542.069885,366.911865,-18558.494141ev2: 542.069885,366.911865,-18558.728516
Left-hand float is the X, the middle float is the Y and the Right-hand float is the Z. These are the same values used for the old D3D and the new D3D9 code.
EDIT:
I think I might be able to solve the origin problem with glFrustum... this will take some testing but the way i'm thinking of it is something along the lines of:
glFrustum(0.f,(float)WinW, 0.f, (float)WinH, 0.1f, 100000.f);
This should set the upper left corner as the origin (or the lower left corner, either one) and then the D3D data should work so long as z and w aren't treated differently from D3D's z and RHW. (again, seems not to be a difference between them other than OpenGl drops the 'rh' prefix.)
[Edited by - RexHunter99 on March 12, 2010 11:56:47 PM]