CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: [HELP] MFC App Using DirectX9 - Recursive Render Issue...

  1. #1
    Join Date
    Feb 2018

    [HELP] MFC App Using DirectX9 - Recursive Render Issue...


    I am a novice C++ programmer and beginner at MFC (even though it's deprecated now... lol), and a beginner at D3D DirectX9.* I want to use DirectX9 so that my application is compatible with older Windows XP machines (I have my reasons)-- but still able to run on Win7, etc.*

    I am trying to create (as simply as possible) a 3D animation file viewer*for Autodesk's XML Animation File (XAF) format.* I am using VS .NET 2003 and DirectX9.

    My project is based mainly on*Frank Luna's very old Direct3D9MFC and D3DSplitWnd projects and other DirectX tutorials (for which I have his PDF's and source code).

    I have created an MFC*Splitter Window project consisting of a Left and Right Pane.* The Left Pane is used to display the XAF file's model hierarchy (it derives from CTreeView) and the Right Pane is used for the D3D DirectX9 display (based on*Frank's*Direct3D9MFC project and derives from CView).

    So I added the CArcBall class, created a groundplane grid (vertex buffer) and a coordsys-axis tripod (shapes)... and in the TreeView I have used MSXML6 to parse the XAF file and create the hierarchy... all of that is working correctly.* I am manually managing the Bones (struct Bone derives from D3DXFRAME).

    All I want is*to render a simple stick-man (spheres representing Bones (D3DXFRAME) and draw lines between them) using a recursive render skeleton function... which I'm using from another old DirectX9 book tutorial.* Eventually the checkboxes in the TreeView will dictate if a bone is drawn or not-- this lets me ignore the mesh objects inside the XAF file (nothing in the XAF file tells me if a Node is a bone or a mesh object-- this will be intuitive to the user while inspecting the hierarchy in the left pane).

    Just to verify I had the DirectX9 working correctly... I instantiated and draw a spinning teapot.

    See screenshots (the teapot is spinning about the Y-axis by the way-- just proving-out how I plan to handle the animated pose frames of the skeleton).

    Here is the problem I am having:
    ...when theApp Document loads on "Open Document" (it opens the XAF file and parses it with MSXML6 and creates the*Bones, populates the Bone struct transforms, and*creates the tree hierarchy), it*successfully parses the XML file and generates/populates the CTreeCtrl (I even added a right-click context menu to check/uncheck all, expand/collapse all from the right-clicked HTREEITEM)... but then the test*Teapot shape and axis tripod shapes (based on cylinders) ALL disappear-- leaving only the Vertex Grid groundplane.* I cannot get the recursive RenderSkeleton function to work.* The RenderSkeleton should at least be recursively rendering a sphere mesh representing the Bone Joints but they do not appear.* I even tried to inject rendering a globally defined sphere but it does not render either.*

    So I feel like something is getting set wrong or wiped out in my D3D settings after the Document loads.* But I cannot see what I am doing wrong (for lack of knowledge)...

    Would*anyone be willing to take a look at my code (I can link you to it on*Bitbucket) and see why my D3D Shapes disappear and why the skeleton shapes will not render?

    Any*assistance is greatly appreciated.* Thanks!
    Attached Images Attached Images   

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)