Javier Ramírez Javier Ramírez - 1 month ago 20
C Question

OpenGL + multiple cameras

Let me see if I understood. If I use multiple viewports I can create several "cameras" in my OpenGL application. Right?

Well, I have an object that can be seen in the viewport 1, but not visible in the viewport 2. If I want the subject appears in both viewports then ...I must draw double!

That means that if I have two objects, if I have two "cameras", I have to draw these objects twice. So everything I have in my scene, I must have to draw double.

Is this okay? Is there another way to split the screen without duplicating objects?

Answer

Is this okay?

Yes, that's how it goes.

Is there another way to split the screen without duplicating objects?

You're not duplicating objects. You can't because there's no such thing as an "object" in OpenGL. OpenGL is just a sophisticated kind of pencil to draw on a framebuffer. There is no scene, there are no objects, there are just points, lines and triangles drawn to a framebuffer.

All you do is draw several pictures of the same thing from different points of view, just as you'd like do it using a pencil on paper.

Comments