Creating more then one vertex or quad? Modern Opengl problem,
Members - Reputation: 143
Posted 29 March 2012 - 07:00 AM
What happens is the bottom left side of my quad seems to stick to the near center point of the frustum for no apparent reason even when I change any of the vertex array values.
I even looked through all my functions trying to find out which one could be causing this error.
The closest I got too was that glfloat vertices array could have been the problem but since playing with every value in the - and non - values and going up and down on the number scale eg, 1 2 3 4 5 6 I come to the conclusion that I'm not doing something right but what ?..
has anyone else experienced this issue and knows of any ways to bypass this or get rid of the problem alltogether?.
here is my main.cpp file http://pastebin.com/g9q8uAsd
thanks in advance
Members - Reputation: 813
Posted 31 March 2012 - 07:45 PM
Also, your function calls don't make any sense
glDrawArrays(GL_QUADS, 0, 6);
glDrawArrays(GL_QUADS, 5, 6);
because a quad needs 4 vertices, but your count value is 6.
an open source GLU replacement library. Much more modern than GLU.
float matrix, inverse_matrix;
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);