How to change viewpoint in openGL, C ++

I have a form and I want to view it from different places defined during runtime. I thought that if I call gluLookAt (...) with the options selected, this could change the location of the view. But it seems not. I think after the change I have to do some refreshing things, I tried glFlush ().

Any help would be greatly appreciated. Thank you so much in advance.

void Keyboard(unsigned char key, int x, int y) { switch (key) { case 'w': glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); gluLookAt(3,2, 0, 0, 0, 0, 0, 10, 0); glFlush(); break; case 's': cout<<"s"<<endl; break; } } 
+4
source share
1 answer

OpenGL is not a scene graph, it's just a complex pencil and paper. If you change the setting of your scene, you must redraw the full scene.

+6
source

All Articles