D3DX, Meshes and Opengl

I’m a big Opengl fan but D3dX is offering some advanced functionality I’d like to exploit and remain with Opengl for rendering.

so to be precise, I wish to:

  1. Open a window with an Opengl context
  2. Use DirectX 9.0 D3DX meshes to do some advanced mesh work
  3. Render the resulting mesh using opengl calls

Has anyone tried this? I can find nothing on the web so far and I’m wondering if there is some gotcha in here I dont know about?

I haven’t tried it.

I have searched for this not long ago. Some people have done some work to make a x file loader.

OpenSceneGraph X file loader
http://www.sandbox.de/osg/

How to write your own lib
http://www.gamedev.net/reference/articles/article2221.asp

There is the .mesh and .skeleton format used in Ogre
http://ogre3d.org/

Thanks for the info V-man. I’ve seen these links before and they are no use to me. I’m not interested in .x format, only in mixing d3dx mesh calls with Opengl drawingcalls. The programs above all parse .x files into a unique mesh format. I wish to use DX meshes.

To be more precise, I wish to define an array in memory directly corresponding to vertices in a d3d mesh, make repeated calls to D3dx routines then read out the mesh and display using opengl.

You can imagine that my arrays will be generated algorithmically, so .x format is no use to me.

However, thanks for taking the time to post the links. I suspect its a matter of trying it…

A problem with many D3DX calls are that they take a D3D device as a parameter. If you want to do stuff at runtime for an OpenGL app that could be a problem. But there’s nothing preventing you from preprocessing stuff with D3DX in a separate app and writing out the results to your own files which you load in GL app.

OK to close this discussion down, I have succeeded. I now have a trivial example of an OGL window with a D3D torus mesh displayed using Opengl calls.

Humus, I solved the issue you mention by using the same HWND to initialise D3D and Opengl device/context, but of course never opening a D3D window means it doesnt bug out.

So there you go it is possible to use the d3dx mesh routines (such as precomputed radiance transfer and N patches) and render using OpenGL.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.