• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Having problems with my translation matrix

## Recommended Posts

flukus    138
I''m trying to make a pnog type game with DX8 and I''m having trouble trying to get the paddle to move using a Translation Matrix. The paddle will draw fine but if I try to move it ti will disapper from the screen. The code seems fairly straight forward enough:
void TexturedQuad::Move(float x, float y)
{
D3DXMATRIX matTranslation, matIdentity;

d3dd->SetStreamSource(0, pVertBuffer, sizeof(Vertex));

D3DXMatrixTranslation(&matTranslation, x, y, 0.0f);
D3DXMatrixIdentity(&matIdentity);
D3DXMatrixMultiply(&matIdentity, &matIdentity, &matTranslation);

d3dd->ProcessVertices(0, 0, 4, pVertBuffer, D3DFVF_MYVERTEX);
}


Could the problem be that I''m using the same buffer for the stream source and destination buffer? Any help is appreciated.

##### Share on other sites
don    431
That code you''ve posted is very odd. Here''s a list of things you need to address:

1) Why are you creating an identity matrix?

2) Why are you multiplying the translation matrix by the identity matrix?