Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


Member Since 02 Jan 2012
Offline Last Active Aug 30 2012 06:42 AM

#4941857 render vbo not working

Posted by Vorel512 on 21 May 2012 - 02:31 AM



glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex)*3,&triangle[0].x,GL_STATIC_DRAW);
You should pass a pointer to "&triangle" and with sizeof(triangle) now you allocate memory for only the first position. And then try to set opengl where to search for specified data like normals. It would be a great start to read and try out some example."
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
    glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(0));
    glVertexAttribPointer(GLKVertexAttribNormal, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(12));
    glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(24));

sizeof() gives you the size of the variable in bytes, not the amount of data stored in them. In your case all vertexes has 8 elements (3+3+2 = 8) and 3 vertexes (3*8=24).

#4899544 Handling sprite (array or vector)

Posted by Vorel512 on 04 January 2012 - 05:00 AM

Use linked lists ( a grovable array).
You can set their size, add elements, remove elements, insert an element somewhere, etc-etc dinamically.

#4899084 Clientside prediction & correction

Posted by Vorel512 on 02 January 2012 - 03:59 PM


Sending commands are much more efficient than sending snapshots of position.
The client should be able to calculate and run the command such as "moveto objectid,x,y,speed".
Sending corrections... I do not get it... The coordinate system should be the same everywhere.
A little difference is acceptable.