Hello,
I loaded my model from an STL file, I don`t have any problem to display and translate it, the problem is when I try to rotate.
My gl_postion is:
Where projection is orthographic matrix, rotation is a simple rotation around Y, translation is a matrix translation of (400, 300, 0) as my window is 800x600, and model is a simple identity matrix.
I think the problem is about axis rotation, I thought that a simple translation to the center could resolve the problem, but it isn`t that.
The viewport transformation will place the clip-space origin in the centre of the viewport. Normally, you’d define the projection matrix so that the eye-space origin is also in the centre of the window (e.g. for an orthographic projection, you’d make the left and right edges equal and opposite, e.g. left=-400 and right=400).
If you can’t do that (e.g. because the eye-space origin needs to be in one corner of the window), the translation should come after the projection transformation and before the rotation.