Representing a grid and rotating around it


I’ve implemented an A* pathfinder in C++ and would like to display the grid (which can be 3d) and the route it’s found in OpenGL. I’ve created an application using GLUT which sets the coordinate system to <-1, -1, gridWidth+1, gridHeight+1, -1, gridDepth+1> and creates a number of cubes which represent obstacles and cubes which represent nodes on the grid that contribute to the route found.

I’ve come somewhat unstuck however when it comes to implementing a way of rotating the scene. I’ve read and tried to follow a number of tutorials but feel as if I’ve missed something somewhat significant. For example, when I follow them I can’t seem to find the right values to start off with for gluLookAt.

Do the parameters of of gluLookAt work like this:
eyeX, eyeY, eyeZ: The location of the camera? Where is this set to by default? I guess that this, along with the angle specified in gluPerspective, determines what ‘quantity’ of the grid we can see?
centerX, centerY, centerZ: A point in the coordinate system where the camera focuses? So I’d want this to intially be <gridWidth/2, gridHeight/2, 0> initially?
upX, upY, upZ This is the same as ‘yaw’?

The relevant code I have currently looks like this:

void display(void){

//Make cubes for every obstacle in the 3d world.
	for(int y=m.height()-1; y>=0; y--){
		for(int x=0; x<m.width(); x++){
			for(int z=0; z<m.depth(); z++){
				if(!, y, z)->obstacle) continue;
				glTranslatef(x+0.5, y+0.5, z+0.5); //Move this cube to its coordinates in the map (and align to the window).

	for(int n=0; n<route.size(); n++){

void reshape(int width, int height){
	glViewport(0, 0, width, height);
	glOrtho(-1, w+1, -1, h+1,-1,d+1); // Set the coordinate system's units in scale with our own map.
} was a good tutorial but I think I need to change the initial values it sets because of my change in coordinate system? Preemptive thanks to anyone who can help me.

I solved my problems by inverting transformations from the camera’s perspective (hopefully that’s the correct terminology) though I’d still like an explanation of gluLookAt possible use in this context as I’m sure it would have been easier!