glulookat

What exactly is the UP vector in OpenGL's LookAt function?

守給你的承諾、 提交于 2019-11-27 20:09:22
this is related to The LookAt target location doesn't matter if it is z = 0 or z = 1000 or -1000? I tried gluLookAt(512, 384, 2000, 512, 384, 0, 0.0f, 1.0f, 0.0f); and things work fine, and now I change the 3rd row (the UP vector), last number to 0.8 : gluLookAt(512, 384, 2000, 512, 384, 0, 0.0f, 1.0f, 0.8f); and it is exactly the same... next I tried and modified the 3rd line, the first number to 0.8 : gluLookAt(512, 384, 2000, 512, 384, 0, 0.8f, 1.0f, 0.8f); Now the view is like it rotated 45 degree to the left. How does this UP vector work? CaptainRedmuff The up vector is used to create a

gluPerspective, glViewport, gluLookAt and the GL_PROJECTION and GL_MODELVIEW Matricies

匆匆过客 提交于 2019-11-27 13:17:34
问题 Original Question I want to use 'gluPerspective', 'glViewport' and 'gluLookAt' to manipulate my camera and screen. Which functions to I apply to which matrix mode? And in what order should I / must I use them? For example, I am trying to set up my screen and camera like this: (But it is not working!) glMatrixMode(GL_PROJECTION) // Apply following to projection matrix - is this correct? glLoadIdentity(); // Reset first glPerspective(45.0, (double)w/(double)h, 1.0, 200.0); // Set perspective

What exactly is the UP vector in OpenGL's LookAt function?

烈酒焚心 提交于 2019-11-26 20:12:49
问题 this is related to The LookAt target location doesn't matter if it is z = 0 or z = 1000 or -1000? I tried gluLookAt(512, 384, 2000, 512, 384, 0, 0.0f, 1.0f, 0.0f); and things work fine, and now I change the 3rd row (the UP vector), last number to 0.8 : gluLookAt(512, 384, 2000, 512, 384, 0, 0.0f, 1.0f, 0.8f); and it is exactly the same... next I tried and modified the 3rd line, the first number to 0.8 : gluLookAt(512, 384, 2000, 512, 384, 0, 0.8f, 1.0f, 0.8f); Now the view is like it rotated