I'm using GLFW3 and OpenGL to visualize measurements from an IMU that I have. I've gotten the simple cube example working and I can rotate it successfully with quaternions that I've input.
However since I'm visualizing an IMU, it is important that I know which way I am looking at it. I would prefer to look at it from a top down view.
Hence I want to keep the cube at the center of the world (0, 0, 0) and look down at it from a corresponding height (0, 0, z) which is where I want my camera to be at. I've the following code, can someone please guide me on how to set up my glLookAt function? All the values that I input make my cube disappear.
void display( GLFWwindow* window )
{
while(!glfwWindowShouldClose(window))
{
// Scale to window size
GLint windowWidth, windowHeight;
glfwGetWindowSize(window, &windowWidth, &windowHeight);
glViewport(0, 0, windowWidth, windowHeight);
// Draw stuff
glClearColor(0.2, 0.2, 0.2, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION_MATRIX);
glLoadIdentity();
gluPerspective( 60, (double)windowWidth / (double)windowHeight, 0.1, 100 );
glMatrixMode(GL_MODELVIEW_MATRIX);
glTranslatef(0,0,-5);
drawCube();
// Update Screen
glfwSwapBuffers(window);
// Check for any input, or window movement
glfwPollEvents();
}