Original Post
i''m trying to get objects within a 3d room i''ve created to move. i''m using the code posted by steg a couple days ago as my base, but i can''t seem to get it to work. the object class i''m writing initializes 4 vertices ( a square object ) and the square''s x,y, and z world coordinates. here is the world transformation function:
void MakeWorldMatrixStripObject4(D3DXMATRIX *pMatWorld, stripObject4 &pObject)
{
D3DXMATRIX MatZ,MatX,MatY,MatTemp;
D3DXMATRIX MatRot;
D3DXMatrixIdentity(&MatRot);
D3DXMatrixRotationZ(&MatTemp, pObject.zRot);
D3DXMatrixMultiply(&MatRot, &MatRot, &MatTemp);
D3DXMatrixRotationX(&MatTemp, pObject.xRot);
D3DXMatrixMultiply(&MatRot, &MatRot, &MatTemp);
D3DXMatrixRotationY(&MatTemp, pObject.yRot);
D3DXMatrixMultiply(&MatRot, &MatRot, &MatTemp);
D3DXMatrixTranslation(pMatWorld,
pObject.xPosWorld,
pObject.yPosWorld,
pObject.zPosWorld);
D3DXMatrixMultiply(pMatWorld, &MatTemp, pMatWorld);
}
and i do this where i want to move the object:
theSquare->xPosWorld += 1.0f;
this only causes the entire world to move, however. what am i doing wrong? ... does each vertice need it''s own world space coordinates? thanks to anyone that can help.
boto0o