View Full Version : how to render one scene for two (different) cameras

05-13-2003, 07:52 AM
Hi OpenGL guru:
One camera (call it agent_cam) renders an image in front of character, and thus excluding the character.

The other camera (call it audience_cam) renders an image from a point located somewhere back of the character in order for people to see the character and environment.

Then the rendered result for agent_cam should be hidden (or so) for the people not to see the rendered image. But still I want to read the buffer (or so) used for the agent_cam rendering, in order to read pixels of the buffer for my own computation.

Any comment for doing it would be very appreciated.
This animation is being done under FLTK

05-13-2003, 08:25 AM
It should be easy. Just render your "agent" scene to the backbuffer and than read those pixels you need (but first glFinish or glFlush or whatever to make sure the scene has been finished drawing). Than donīt swap the buffers but just render the second scene to override the result.
Or try pBuffers, maybe they are helpful, too, but i donīt know much about them.