Advanced image capturing

Hi.

I’m working on molecular dynamics simulation, with more than 1 000 000 atom objects (C++, integrated with CUDA).
I have defined couple Camera objects (Position, Eye, Perspective, Near plane, Far plane, screen width and height)…
Calculation of 1 step of simulation takes time and after each step i need to capture images from all cameras…

Any ideas how to solve this problem?

I found an example of TGA image capturing, integrated with GLUT.
This works good but only for one camera (another camera can have different screen width/height, perspective… So i need one window for one camera (more glutCreateWindow calls) and i don’t know how to solve stuff about static methods for glutDialsFunc and glutReshapeFunc on more windows)

Is it possible to do it this way:

  1. Initialize one window

When TakeScreenShots() is called:
2) Draw atoms in the scene

  1. Resize window to camera width/height
  2. Setup perspective, near and far plane
  3. Move camera to position and camera look
  4. Take screenshot.
  5. Go to 3 for each camera

Thanks for any ideas and help …

Hi,

you have to render your scene multiple times to achieve what you want. Your step 2) is actually step 5a).
I don’t see any reson why this should not work, but of course it will be slower than just rendering for one camera. But as I understand it is no real time application so it may be acceptable.
You may also want to take a look at FBOs and if they can help you speed up your application.

Like satan said, renderScene() after setting up the camera.
I’d try it this way:

  1. Initialize one window

When TakeScreenShots() is called:
2) Remember window size
3) Resize window to MAXIMUM camera width/height

  1. Setup perspective, near and far plane

  2. Move camera to position and camera look

  3. glClear, Draw atoms in the scene

  4. Take screenshot.

  5. Go to 4 for each camera

  6. Restore window size