Search code examples
openglglut

How can I render one whole teapot in four viewports (each viewport render one part of the teapot) with OpenGL(GLUT)


As stated in the title, I need to render one part of the teapot in each of the four viewports, and the four parts together are a complete teapot. I can now complete the effect in gluOrtho2D. But in gluPerspective, I cannot use gluLookAt to change the observation position.

This is my result Without gluLookAt:

img


Solution

  • Did you by chance try to emplace the rendering in each viewport by trying to transform it there using modelview and projection matrices?

    If so, here's a hint: Consider why the function glViewport is called that way and not glWindow (nonexistent). Just use glViewport to define the subset of the window you want to render to.