Loading a .X model in DirectX 9

后端 未结 1 1054
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-22 15:28

I\'m trying to make my first 3D demo for my portfolio but I\'m having problems loading in multiple .X files so that I might be able to make a simple game.

I\'ve worked

相关标签:
1条回答
  • 2021-01-22 16:07

    When I was learning DirectX 9, this site was a good place to look for information.

    In a nutshell, you have to call D3DXLoadMeshFromX or one of its derivative functions to load the mesh object from a file (or memory).

    You cannot "move" the object per se, you have to push/pop matrices to accumulate a translation/rotation for each object. e.g for a rotation:

    float fAngle = 2.f;
    D3DXMATRIXA16 matWorld;
    D3DXMatrixIdentity(&matWorld); // Identity Matrix
    D3DXMatrixRotationY( &matWorld, fAngle );
    g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
    
    0 讨论(0)
提交回复
热议问题