i don't seem to be getting much help w/ this on the gamedev boards so i'm going to post it here:
i'm trying to get objects within a 3d room i've created to move, 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.



LinkBack URL
About LinkBacks



