Original Post
I'm trying to mimick this directx transform code in OpenGL:
Quote:using:
D3DXMATRIX tmp; D3DXMatrixTranslation(&matView, -x, -y, 0.0f); D3DXMatrixScaling(&tmp, hscale, vscale, 1.0f); D3DXMatrixMultiply(&matView, &matView, &tmp); D3DXMatrixRotationZ(&tmp, -rot); D3DXMatrixMultiply(&matView, &matView, &tmp); D3DXMatrixTranslation(&tmp, x+dx, y+dy, 0.0f); D3DXMatrixMultiply(&matView, &matView, &tmp);
Quote:I've read up on the functions and this seems correct to me, but I'm new to GL and probably missing something! The GL code does not produce the same result. Can anybody help?
glTranslatef(-x, -y, 0.0f); glScalef(hscale, vscale, 1.0f); glRotatef(-rot, 0, 0, 1); glTranslatef(x+dx, y+dy, 0.0f);