0

I have got a small question while coding. I want to draw a cube, using GLUT in C++. Im using the window to viewport transformation to draw the cube in the middle of the screen.

Now the viewport window has a size, and if I move the cube in the viewport it moves fine, however it leaves or "hangs out" from the side of the viewport window.

How could I make that if some parts of a cube leave the viewport window then it would disappear?

Drawing in the rest of the window after i draw the cube in the viewport using GL_POLYGON is not a solution.

Is there a way to create separate "canvases", or something like that in GLUT?

1 Answers1

0

Found my answer using glScissor.

  • Can you add what you did. Some code would be nice to go along with it. This is so that your answer can be useful for others who come with the same question. Thanks – smac89 Apr 10 '18 at 22:38