I've been running into a problem with a 3D engine I've been working on. The translation applied by the transformation matrix isn't correct, and frankly, I have no idea why.
The transformation matrix I am using:
{ 1f, 0, 0, 0,
0, 1f, 0, 1f,
0, 0, 1f, 0,
0, 0, 0, 1f }
This transformation matrix is applied to a normal cube consisting of two triangles, which then warps the edges of the cube instead of applying a translation.
Original rectangle:
Warped rectangle:
P.S. Any translations on the z-axes(near/far) works properly, only the x-(left/right), and y-axes(up/down) warp the cube.
Im new to OpenGL, but as far as I know, matrices in OpenGL are represented using column-major matrix ordering: That means you should use the transposed transformation matrix:
{ 1f, 0, 0, 0,
0, 1f, 0, 0,
0, 0, 1f, 0,
0, 1f, 0, 1f }