Results 1 to 7 of 7

Thread: Header _D3DXFRAME and _D3DXMESHCONTAINER

  1. #1

    Header _D3DXFRAME and _D3DXMESHCONTAINER

    The new DX9-Framework has been translated to

    _D3DXFRAME = packed record
    ....
    end;

    and

    _D3DXMESHCONTAINER = packed record
    ....
    end;

    To my mind this should be classes instead of records. When I want to use them for loading meshes/animations it is necessary to derive new classes from the frame and meshcontainer, but that's impossible with records.

    Is it a fault in the headerfiles or am I wrong?

    Carsten

  2. #2

    Header _D3DXFRAME and _D3DXMESHCONTAINER

    There are a number of bugs in this area of D3DX9 header translation (updated version will be posted soon) what will not allow you to implement loading meshed this way.
    But below I provide code snippet from working Delphi sample what uses this technique (and this sample will be published as soon as haders will be available).
    General idea what you can't currently in Delphi declare inherited records what are statically allocated. One of possible solutions can be to used old Object/Turbo Pascal "object" keyworded classes, but more streamlined solutions is to declare another record what includes original data fields.
    [pascal][background=#FFFFFF][normal=#000000][number=#0000FF][string=#0000FF][comment=#248F24][reserved=#000000] PD3DXFrameDerived = ^TD3DXFrameDerived;
    TD3DXFrameDerived = packed record { public TD3DXFrame - waiting for Delphi8 }
    Name: PAnsiChar;
    TransformationMatrix: TD3DXMatrix;

    pMeshContainer: PD3DXMeshContainer;

    pFrameSibling: PD3DXFrame;
    pFrameFirstChild: PD3DXFrame;
    ////////////////////////////////////////////
    CombinedTransformationMatrix: TD3DXMatrixA16;
    end;
    [/pascal]
    Another solutions is to declare records something like this (have not tryied myself):
    [pascal][background=#FFFFFF][normal=#000000][number=#0000FF][string=#0000FF][comment=#248F24][reserved=#000000] PD3DXFrameDerived = ^TD3DXFrameDerived;
    TD3DXFrameDerived = packed record { public TD3DXFrame - waiting for Delphi8 }
    FrameOriginal: TD3DXFrame;
    ////////////////////////////////////////////
    CombinedTransformationMatrix: TD3DXMatrixA16;
    end;
    [/pascal]
    Generally problem with classes is what whey can't be allocated statically.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    Header _D3DXFRAME and _D3DXMESHCONTAINER

    Fixes part one: http://clootie.narod.ru -- new DirectX9 headers!!!
    There are only 10 types of people in this world; those who understand binary and those who don't.

  4. #4

    Header _D3DXFRAME and _D3DXMESHCONTAINER

    Fixes part two: http://clootie.narod.ru -- SkinnedMesh sample what shows how to load / parse and animate skinned meshes with help of D3DX9 library. :roll:
    Shows how to use and derive/implement: TD3DXFrame, TD3DXMeshContainer, ID3DXAllocateHierarchy, ID3DXSkinInfo, D3DXLoadMeshHierarchyFromX etc.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    Header _D3DXFRAME and _D3DXMESHCONTAINER

    Fixes part three http://clootie.narod.ru -- MeshHierarchy sample.
    This sample shows how to load and save hierarchical meshes using D3DX9 functionality. Sample can load and save not only "standart" data but also custom (user supplied) data.
    Demonstrated bits: inheritage of TD3DXFrame, ID3DXAllocateHierarchy, ID3DXLoadUserData, ID3DXSaveUserData and usage of D3DXLoadMeshHierarchyFromX, D3DXSaveMeshHierarchyToFile.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  6. #6

    Header _D3DXFRAME and _D3DXMESHCONTAINER

    thanks a lot!
    The skinned mesh sample works pretty fine, the mesh-hierarchy returns some errors when loading the x-File, while the hierarchy-tree is displayed correctly.
    I have not had enough time to take a closer look.

    Carsten

  7. #7

    Header _D3DXFRAME and _D3DXMESHCONTAINER

    Error message showing by MeshHierarchy sample is by design. It's to note that mesh contains some advanced data that is not parsed by sample and so will not be saved when you'll save modified mesh (with custom data).
    There are other problems with sample as some patterns of Loading/Loading with user data/Saving with user data lead to GPF type erros that I think is the problem in MS D3DX9 code.
    There are only 10 types of people in this world; those who understand binary and those who don't.

Bookmarks

Posting Permissions

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