Creating more then one vertex or quad? Modern Opengl problem

Started by
1 comment, last by DominicHughes 12 years ago
[color=#333333]Hey all I'm just trying to add another quad to my frustum and when doing so I get this weird little error.

[color=#333333]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.

[color=#333333]I even looked through all my functions trying to find out which one could be causing this error.

[color=#333333]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 ?..


[color=#333333]has anyone else experienced this issue and knows of any ways to bypass this or get rid of the problem alltogether?.

[color=#333333]here is my main.cpp file http://pastebin.com/g9q8uAsd


[color=#333333]thanks in advance
Advertisement
You should check and see if sizeof(GUIVertices) returns the value that you think it should return.

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.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Fixed this ages ago ;P nobody answered for ages

This topic is closed to new replies.

Advertisement