   OpenGL object rotation
  I'm still new to OpenGL.  I'm trying to rotate a 2D sprite around it axis.  I'm using vertex arrays to draw everything.  Objects are grouped by sprite sheets to draw them in a single vertex array.  If the rotation is changed from object to object, the vertex arrays are seperated.  Here is my code for setting up OpenGL:glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(0, (GLfloat)width, 0, (GLfloat)height, -1, 1);glMatrixMode(GL_MODELVIEW);glLoadIdentity();Here is the code for drawing the vertex arrays:void cTextureManager::DrawTextureSections(uint textureId, GLfloat vertexs[], GLfloat coords[], uint quadCount, GLfloat rotation ){if( !glIsEnabled( GL_TEXTURE_2D ) ){glEnable( GL_TEXTURE_2D );}    //check if the right texture is bound    if( _currentTexture != textureId )    {   //bind texture   glBindTexture(GL_TEXTURE_2D, _textures[textureId].texture );   //set graphics varible   _currentTexture = textureId;    }glLoadIdentity();glTranslatef(-g_pCamera->GetXposition(), -g_pCamera->GetYposition(), 0.0);glRotatef(rotation,0.0f,1.0f,0.0f);glEnableClientState(GL_VERTEX_ARRAY);glEnableClientState(GL_TEXTURE_COORD_ARRAY);glVertexPointer(2, GL_FLOAT, 0,vertexs);glTexCoordPointer(2, GL_FLOAT, 0, coords); glDrawArrays(GL_QUADS,0,quadCount); glDisableClientState(GL_VERTEX_ARRAY);glDisableClientState(GL_TEXTURE_COORD_ARRAY);}Everything draws correctly, but when I try to rotate an object it seems to disappear from the screen.  I have tried changing the axis of rotation, but it doesn't seem to help.  Any tips?   
  Well that sounds like the order of transformations is incorrect, like the object is rotated at a new center due to a translation. Change the order then from:glTranslatef(-g_pCamera->GetXposition(), -g_pCamera->GetYposition(), 0.0);glRotatef(rotation,0.0f,1.0f,0.0f);To this:glRotatef(rotation,0.0f,1.0f,0.0f);glTranslatef(-g_pCamera->GetXposition(), -g_pCamera->GetYposition(), 0.0);Been awhile since I used OpenGL or intermediate mode soo I don't remember which order of transformations it expects. Anyway it's worth a try   ;  Is this purely a 2d game? I see you're rotating about the Y axis, which means your quads will be coming off of the 2d plane. If your coordinates are pixel based (im guessing based on glOrtho args), then you have very very narrow near and far clipping planes, so your sprite is probably being clipped by those planes.Have you tried rotating about Z axis? You say you tried to change it, but I don't know if you actually tried Z axis. Otherwise try to rotate by small amounts, if you rotate by 0.1 degree does it still dissappear?EDIT: I believe his order of operations is correct as it is.   ;  I have tried changing the order,but it does not make a difference.If I change it to the Z-Axis and do a small rotation, I can see the object, but it seems to be rotating based on the lower left side of the window.   ;  Oh I understand. I think you're probably putting your "world coordinates" into your vbo, which you don't want to do.Assuming you're drawing quads, then your vbo should just be like four points centered around zero, like this: -10,-10-10,+10+10,+10+10,-10Then when you draw the vbo, you translate this into position you want, then rotate it.glLoadIdentity();glTranslatef(-g_pCamera->GetXposition(), -g_pCamera->GetYposition(), 0.0);glTranslatef(spriteXposition, spriteYposition,0.0); //move sprite into placeglRotatef(rotation,0.0f,0.0f,1.0f);;  I am passing world coords to the vbo.  I'll have to switch things up a bit.   ;  So if I adjust the vertex array's to be centered around zero, is there a way to put multiple tiles into a single vertex array?   ;glOrtho(0, (GLfloat)width, 0, (GLfloat)height, -1, 1);Explain that to me.   ;Quote:Original post by mdmaslinSo if I adjust the vertex array's to be centered around zero, is there a way to put multiple tiles into a single vertex array?Every single tile you have would basically have 4 vertices, all of which would be centered around some point. A good example would be particle systems, which could have hundreds of individual particles, each one at a different point, but all centered around the single point (usually in the middle of where the particle system sits). Does that clear it up a bit?[EDIT]Just to let you know, each one of those particles will usually be kept stored in a single vertex array.Quote:Original post by TheBuzzSaw *** Source Snippet Removed ***Explain that to me.What it does is set up the viewing area in a 2D view (which means objects that are really far away will still look the same as they would close up). The arguments define the bounding box for the viewing area (left, right, bottom, top, near, far).   ;  I know what the function does, but I am baffled at the parameters you have chosen. You are going against the standard 3D paradigm of having 0,0,0 be the center of the scene.   