This commands sets the position of an object using a Direct3D transformation matrix. It is undocumented, but very useful for advanced users, and also for integrating with other APIs such as physX.


void dbSetObjectWorldMatrix ( int iID, D3DXMATRIX* pMatrix );


To use this function, we first need to create a D3DXMATRIX containing the position, rotation and scaling of the object in question. This is not hard when using the DirectX functions for matrix creation, but remember to include d3dx9.h when using these. After this we pass a pointer to this matrix to the function. This command somtimes messes up unless you use dbsetobjectposition before this.



D3DXMATRIX matrix;
D3DXMatrixScaling(&matrix, size,size,size);
dbSetObjectWorldMatrix(1, &matrix);

This creates a scaling matrix every frame that gradually makes object 1 bigger.

See AlsoEdit