View Full Version : change camera view in a display list

01-24-2011, 09:38 AM
how could i change the camera view in a display list?
i tried this code but it only displays the first camera view




where is the error?

carsten neumann
01-24-2011, 09:42 AM
You only render one view (the one with the glCallList call), the first one only compiles the display list, but does not render anything (did you mean glNewList(1, GL_COMPILE_AND_EXECUTE)? ).

01-24-2011, 10:00 AM
after glEndList() i call glCallList(1) for the first time. i call it again in the last line!

carsten neumann
01-24-2011, 10:12 AM
sorry, I'm blind. Is your window at least 600 pixels wide (that is what you need for your glViewport call)?

If that is not the problem, it is probably somewhere in code you did not post.

Dan Bartlett
01-24-2011, 10:15 AM
What does the code in createBox() do? If it calls glLoadIdentity() for example, then the gluLookAt will be ignored in both cases.

Otherwise, putting "glLoadIdentity();" before the 2nd gluLookAt call might help, since you're calling gluLookAt twice without resetting the modelview matrix.

01-24-2011, 10:42 AM
createBox() doesn't call glLoadIdentity(), it creates a simple box. i tried to put glLoadIdentity() before the 2nd gluLookAt but it only reflects horizontally the image, but still can't change camera view. the window's size is 600*300. on the first half there is the gluLookAt(100,100,100,0,0,0,0,1,0) camera view(that is what i wanted), but on the second half i see the same image of the first half!