Image Jerks Around w/o performing translation

I’m in the process of trying to render a few meshes in OpenGL for an assignment. I’m rendering the object like so:


void display (void){

glClear(GL_COLOR_BUFFER_BIT);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
gluLookAt(0.0,0.0,0.0,5.0,5.0,5.0,0.0,1.0,0.0);
glutWireCube(size)

glBegin(GL_TRIANGLES);
for (i = 0; i < numtriangles; i++){
   for (j = 0; j < 3; j++){
      glVertex3dv(&vertices[triangles[i*3+j]*3]);
}

glEnd();
}


I’m getting an image that does this: https://imgur.com/a/PhTXk

I’d really appreciate any help in figuring out what the heck is going on. I hope this post is within rules. I’m really having a tough time getting this working.

[QUOTE=Heisenberg;1291092]I’m getting an image that does this: https://imgur.com/a/PhTXk

I’d really appreciate any help in figuring out what the heck is going on.[/QUOTE]

It appears that the gluLookAt() call within display() isn’t the only place that the model-view or projection matrices are being modified. Most matrix operations (including gluLookAt) multiply a matrix with the current matrix. If you need to ignore any existing transformation, call glLoadIdentity() first (and also call glMatrixMode(GL_MODELVIEW) if you can’t be sure that setting is already in effect).