Given a 3D model in a screen, what percentage of the view is the model and what percentage is the background?
Basically, I have a 3D model that I want to calculate the cross sectional area of the model as it flies through space…basically, imagine a vehicle flying, how much of it is flying into the wind (effectively the cross-sectional area)?
I posted a similar question in the JOGL forum since I’m using JOGL for my development but this is more accurately an OpenGL question. One thing I do know is that I need to perform this calculation while in an orthographic view instead of perspective…that’s besides the point. One suggestion I got was to search for the “Occlusion Query” topic and I have found some info and in particular this demo code: http://www.codesampler.com/oglsrc/oglsrc_7.htm#ogl_occlusion_query. That example is nice but it seems to me like the occlusion query concept is a hardware (video card) solution but I’m looking for something that is not dependent on the hardware, per se.
Basically, I want to code some solution that would run in the background without changing my perspective view to orthographic view…something that runs in the background and effectively takes a screen shot of the view that I want and then gets me the buffer of pixel data which I could then search myself and count the number of background and model pixels. Worst case I would need some image capture code that could retrieve the buffered view before it is rendered and store that data for me to search and then clear the buffer so the orthographic view is not rendered but then my perspective view gets rendered.
The main problem that I have is my lack of OpenGL vocabulary and so searching for this concept is hard…do you have any suggestions? gluUnproject() is one thing that I saw but I am still investigating…do you know what else to search for? Do you know a possible solution?
I hope all of that was clear…I would appreciate any info. Thanks.