additive matrices?
what im trying to do is have say a node and a child node, the child node inherits position and rotation from its parent
what i tryed is to multiply the parents world transform matrix with the childs world transform matrix, but this seems not to work.
You want to multiply the child''s rotation matrix with the parent''s world transformation matrix (I think). Matrix multiplication is not communitive.
transform of parent class:
head parent:
children:
children can inherite from other children (im actually trying to do a skeletal/heirachical set up)
head parent:
D3DXMATRIXA16 matRotation; D3DXMATRIXA16 matTranslation; //D3DXMATRIXA16 matWorld; // this is part of the class D3DXMATRIXA16 matScale; D3DXMatrixRotationYawPitchRoll( &matRotation, rotation.x, rotation.y, rotation.z); D3DXMatrixTranslation( &matTranslation, position.x, position.y, position.z); D3DXMatrixScaling( &matScale, scale.x, scale.y, scale.z); D3DXMatrixMultiply( &matWorld, &matRotation, &matScale); D3DXMatrixMultiply( &matWorld, &matWorld, &matTranslation );
children:
//again matWorld is a member variable fo the class//where parent is a pointer to the parent classD3DXMATRIXA16 matRotation; D3DXMATRIXA16 matTranslation; D3DXMATRIXA16 matScale; D3DXMATRIXA16 matParent = parent->matWorld; D3DXMatrixRotationYawPitchRoll( &matRotation, rotation.x, rotation.y, rotation.z); D3DXMatrixTranslation( &matTranslation, position.x, position.y, position.z); D3DXMatrixScaling( &matScale, scale.x, scale.y, scale.z); D3DXMatrixMultiply( &matWorld, &matRotation, &matScale); D3DXMatrixMultiply( &matWorld, &matWorld, &matTranslation );
children can inherite from other children (im actually trying to do a skeletal/heirachical set up)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement