Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Creating more then one vertex or quad? Modern Opengl problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 DarkHorseKnight   Members   -  Reputation: 143

Like
0Likes
Like

Posted 29 March 2012 - 07:00 AM

Hey all I'm just trying to add another quad to my frustum and when doing so I get this weird little error.

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

Sponsor:

#2 V-man   Members   -  Reputation: 805

Like
0Likes
Like

Posted 31 March 2012 - 07:45 PM

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);

#3 DarkHorseKnight   Members   -  Reputation: 143

Like
0Likes
Like

Posted 02 April 2012 - 02:07 AM

Fixed this ages ago ;P nobody answered for ages




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS