Link to home
Start Free TrialLog in
Avatar of Knossos
Knossos

asked on

VB: Matrices: Object manipulation

Hi, I'm having some trouble working out how to manipulate a single mesh when I have multiple meshes in my world.

At the moment, my mesh creation code is:
        Set objMesh(Index).Mesh = myDX.D3DX.LoadMeshFromX(App.Path & "\resources\models\" & strModel & ".x", D3DXMESH_MANAGED, myDX.D3DDevice, Nothing, mtrlBuffer, objMesh(Index).nMaterials)

My matrix manipulation code is:
        D3DXMatrixTranslation matTranslation, 0, 0, 0
        D3DXMatrixRotationYawPitchRoll matRotation, RotX / 5000, RotY / 5000, RotZ / 5000
        D3DXMatrixScaling matScaling, 1, 1, 1
        D3DXMatrixMultiply matTransform, matRotation, matTranslation
        D3DXMatrixMultiply matTransform, matTransform, matScaling
        D3DDevice.MultiplyTransform D3DTS_WORLD, matTransform

I understand the general theory behind it, however I have no idea how to rotate a single object. Whenever I use code like this it just rotates everything.

Thanks for any assistance,
Knossos.
ASKER CERTIFIED SOLUTION
Avatar of davebytes
davebytes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial