Hi, I have a curious problem that I’m not sure how to tackle…this may be simply an OpenGL question but also may be a JOGL question…not sure.
I have a 3D scene in which there is a vehicle…and this vehicle is moving forward with wind hitting it. Well, I need to figure out the cross sectional area of the vehicle that is in the wind. Basically the main way I think of doing this is to take a screenshot from the wind point of view looking back at the car and then calculate the number of pixels of the car that are in the screenshot - basically subtract the number of background pixels to get the result cross sectional area of the vehicle.
Currently my scene is composed of a perspective view but I know that I would need to use an Orthographic projection.
So, my first question is how do I convert gluPerspective() to glOrtho()…I tried putting in the screen width and height for the first 4 elements of glOrtho() and the same near and far clipping plane distances for the last 2 elements, but I did not get the same view as I did with gluPerspective(). I figure this might be an easy fix and I need to do some research here so don’t trouble yourself too much with this question.
The main question is how do I get the “screenshot” and do all of the changing from the Perspective view to the Orthographic view without changing the actual view for the user…basically I would need an instantaneous screengrab without making the view flicker or anything bad. Is there a way to basically get the screen data in some buffer so that I’m not actually having to store an image file or any such thing?
Geez, I hope these questions were reasonable…this is my first sort of thought at solving the problem so I apologize if I came to early before having flushed out all the issues.