Thanks Robert and Ulrich, You are right, the call to parseSection is a bit of a work-around while parseFrame is being implemented. A working parseFrame should end up looking very much like parseSection.
A decent .x spec: http://local.wasp.uwa.edu.au/~pbourke/dataformats/directx/ According to this spec, "the frame can contain objects of the type Mesh and a FrameTransformMatrix." I might end up needing to handle the matrices, but at this point I think it's more likely that our modeler can just export models without the matrices, and the parseSection will be good enough as-is. I've added an option on our local build that makes the handedness swap in ReaderWriterDirectX.cpp an option. Our modeler is using XSI, which has a DirectX export but it puts out right handed coordinates, so the hand swap isn't necessary. I don't know how common of an issue this is, but can provide my changes. -Aric ________________________________ From: Robert Osfield <[email protected]> To: OpenSceneGraph Submissions <[email protected]> Sent: Monday, March 23, 2009 4:29:33 PM Subject: Re: [osg-submissions] DirectX plugin minor fixes Hi Aric (and Ulrich) I've just done a code review. The changes to ReaderWriterDirectX.cpp look sensible, but the changes to directx.cpp w.r.t parseFrame being replaced by parseSection suggest to be a workaround to unresolved problems that may well introduce more oddities in behaviour. I've merged and submitted to changes to ReaderWriterDirectX.cpp, but the changes to directx.cpp I will be holding back pending further discussion with yourself, Ulrich and myself. The first step should probably be to find an online spec for the .x format, and to provide specific examples of .x that break the present loader. My expectation is that the parseFrame() function will need to be fixed, as I'm not the author of this code I can't say what this fix might be. Cheers, Robert. On Thu, Mar 19, 2009 at 10:02 PM, Aric Aumann <[email protected]> wrote: Hi Robert, I ran into some issues with the directX loader plugin, here's some minor tweaks that helped. Changes described apply to files in the 2.8.0 release. path - OpenSceneGraph-2.8.0/src/osgPlugins/x I made a few minor changes to ReaderWriterDirectX.cpp and directx.cpp (attached): In directx.cpp: Changed a call from "parseFrame" to "parseSection". The call to the parseFrame function was breaking the recursive brace-tracking mechanism in parseSection, so it was kicking out of nested braces too early. In ReaderWriterDirectX.cpp: Changed behaviour of convertFromDX from "return null if no texture coords" to "don't copy texture coords if no texture coords". I still am unable to load about half of Microsoft's .x files from the DirectX SDK, but some do load. The ones that don't are either binary or they use some non-simple geometry descriptions. Tested on Windows XP/VS8. Thanks, Aric _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
