PDA

View Full Version : Capture World XYZ Coord for Entire WIndow



Bill1322
04-05-2012, 08:35 AM
Hi,

What is the most efficient way of capturing the XYZ world coordinates of an entire scene as seen from the camera's viewpoint? I've found threads regarding picking a few points from the scene using a mouse, but have not been able to find anything regarding capturing the entire scene.

Thanks,
Bill

carsten neumann
04-05-2012, 09:47 AM
One way to do this is to use an FBO with two color attachments, one to store the regular color output and a second (with a floating point format) to store world xyz.
You can also reconstruct world xyz from the depth buffer and knowledge of the view & projection matrices.

As for most efficient, that depends on what your measure of efficiency is: amount of programmer work, runtime performance, memory consumption, etc.

Bill1322
04-05-2012, 10:26 AM
Carsten,

Thanks. You make a good point regarding efficiency, I was anything but precise. I am most concerned about runtime performance.

Thanks,
Bill