   Question with DirectX (please help)
  Hello guys, I have some questions would like to ask. How am I going to convert 2 different objects coordinate in order they are in the relative coordinate?Maybe you don't understand what I'm saying so I'll use an example to explain:- I have 1st object with the object has its own world matrix (assume matWorldA)- I have 2nd object with the object has its own world matrix (assume matWorldB)- Now I scale the 1st object become bigger and move up 5 units (assume Y = 10)- Now I scale the 2nd object become smaller and move up 5 units (asumme Y = 10)So the result of moving two objects is: the first object will be placed upper than 2nd object but what I want is to make the two objects place together. After that, I continue move 2nd object up until it has the same position as 1st object.By doing so, graphically, I can get two objects in the same place, but the problem is, Y-value for 2nd object might not be 10 anymore, maybe 15 due to the extra movement.My question is, is there any function can convert the Y so that both Y are showing their value relative to the general world? I want both of the Y-value be 10 eventhough 2nd object has translated more than 1st object.Kindly looking for reply.Thanks.   
  Taking a guess here, but it sounds like you need to create a hierarchy and then have both of these objects as children of a single other node. Then when you move the parent node, both objects move in relation to it when you concatenate the matrices.   ;  Hmm, not really... I think I've roughly solved it but now I'm having problem with collision detection :(   ;  Maybe I can help you. Here is how I'm doing it:void Actor::RecalcTransforms(){//Matrices we needD3DXMATRIX matWorld,matScale,MatRot,MatTemp;//Temporary translationD3DXVECTOR3 Trans;//Copy from the original location, //so we can modify it without hurting anythingTrans=Location;//Devide Trans through Scale (Important!)Trans.x/=Scale.x;Trans.y/=Scale.y;Trans.z/=Scale.z;//Apply translation to the WorldMatrixD3DXMatrixTranslation(&matWorld,Trans.x,Trans.y,Trans.z);//Now scale another matrixD3DXMatrixScaling( &matScale, Scale.x, Scale.y, Scale.z );//And multiply themD3DXMatrixMultiply(&matWorld,&matWorld,&matScale);//Apply rotationD3DXMatrixIdentity(&MatRot);D3DXMatrixRotationX(&MatTemp, Rotation.x);    // PitchD3DXMatrixMultiply(&MatRot, &MatRot, &MatTemp);D3DXMatrixRotationY(&MatTemp, Rotation.y); // YawD3DXMatrixMultiply(&MatRot, &MatRot, &MatTemp);D3DXMatrixRotationZ(&MatTemp, Rotation.z);// RollD3DXMatrixMultiply(&MatRot, &MatRot, &MatTemp);// Apply the rotation matrices to complete the world matrix.D3DXMatrixMultiply(&WorldMatrix, &MatRot, &matWorld);}Note the important comment. This will force your mesh to be rendered in the right place (Same as "Location" is), but will allow scaling.Hope that helps :)Of course only if you still need it... :)   