How to create complex 3d Objects with direct3d?
-
I would like to model the 3d object, consisted of two parts (A1 and A2). The angle between A1 and A2 is 150°. A1 and A2 are cylinders. The 3D object (A1 and A2) is lying on the XY plane.
I would like to rotate the 3d object around the A1 axis. The render plane has to be XZ. I don’t know how to rotate the 3d object around A1 axis. I use different combinations of the following functions:D3DXMatrixRotationY(&R11, D3DX_PI * D3DXToRadian(0));
D3DXMatrixRotationAxis(&A1, &D3DXVECTOR3 (0.0f, 1.0f, 0.0f), D3DXToRadian(30));
D3DXMatrixRotationZ(&R12, D3DXToRadian(20));
D3DXMatrixTranslation(&T11, 20.0f, 5.0f, 0.0f);
D3DXMatrixRotationX(&R13, D3DXToRadian(40));
HR(gd3dDevice->SetTransform(D3DTS_WORLD, &(R11 * A1 * R13/* * T11 * R13*/)));Unfortunately I don’t understand how to create a child object (A2). When I rotate the object A1, the child object A2 has to be rotated automatically around the A1 axis.
Could you help to resolve the problem?
Regards