Hi guys and gals
I'm busy writing the basic framework for the InfinitEngine for the InfiniteSpace-online project.
Now I would like to be able to support both Opengl and DirectX. The current idea is that the correct dll is loaded a runt-ime based on which rendering engine you want to use. this works very well, and I have a very basic triangle appearing in both Direct and Opengl.
Opengl
DirectX
Now some of you will be able to spot the problem. Because DirectX used a Left Handed coordinate system, the triangle in the DirectX looks different. Also the triangle looks further away in the DirectX window, dispite having the same eye location and look at points.
Now I have read some documents about this problem , the solution M$ give is to revers the vertex order on every vertex you send to get the same results and to scale the view matrix by -1 in the z direction. This is the document I found
http://msdn.microsoft.com/library/de...te_Systems.asp
Now there has to be a better way than this. I'd rather not have to put in extra processing to sort out my verticies for all calls to directX. And to be honest I haven't done any directX coding for about 6 years so I wouldn't know how to scale the view matrix by -1 in the z direction.
Has anyone tried to support both opengl and directx before? If so how did you resolve this problem?
Any ideas?
Dean
Bookmarks