DirectX 9 With No SDK Installed - How To Translate a D3DMATRIX?

23 Views Asked by At

I'm trying to follow a tutorial on DirectX, and the tutorial is working with DX9. I do not have the older SDK (June 2010) installed, and would prefer to keep it that way. All the blurb I can find says 'everything's now in the Windows SDK'.

I've got a basic app running, showing a triangle on the screen - by supplying pre-transformed vertices. Now I want to start doing the transforms from model to world space (and the other pipeline bits).

The problem is, the tutorial uses D3DXMATRIX, and that is deprecated in the new SDK so I don't have the header files for it.

The code calls SetTransform(D3DTS_WORLD, &matTranslate), which actually takes a D3DMATRIX. I can declare a D3DMATRIX, no problem. The problem is that the tutorial uses D3DMatrixTranslation(), which is also in the older SDK.

Irritatingly, whenever I search for "D3DMATRIX translation" it always comes up with D3DXMATRIX - I cannot for the life of me find anything for a D3DMATRIX.

I have scanned directxmath.h, the advised replacement, but that only deals with XMMATRIX (and for some reason Visual Studio says XMMatrixTranslation is undefined). I've also scanned d3d9.h where SetTransform() is defined, and d3d9types.h where D3DMatrix is defined... but I cannot find anything about translating, scaling, and rotating.

Are there functions - in the Windows SDK stuff for DirectX - that transform D3DMATRIX?

A link to a DX10 tutorial using XMMATRIX would be OK, if anyone has one - as long as it starts from the ground up - but since D3DMATRIX and SetTransform() exist in the Windows SDK, I'd prefer to find that 'missing link' and know how to manipulate D3DMATRIX.

Can anyone help?

0

There are 0 best solutions below