Reputation: 87
I'm currently creating a application in java and I'm using Jogl to render a 3d model. Have a few questions regarding getting data out of Jogl/openGL.
After the model has finished drawing I want to extract the screen coordinates of all the visible vertices that have been drawn to the screen excluding the ones that are hidden or are off screen.
Also is there anyway you can tell what vertex the screen coordinate is related to?.
I have had a look at the feed back mode but I'm not sure I'm going to get the data I'm after, either that or I'm not understanding it correctly.
Any answers or ideas would be appreciated.
Regards
Upvotes: 0
Views: 114
Reputation: 162367
OpenGL is a localized rasterizing API. Once it drew a primitive it forgets about it. There's no camers, there's no scene. All it sees are pixel based framebuffers and instructions to draw points, lines and triangles to it, with the positions and colors determined by shader programs.
If you can avoid it, I wouldn't use OpenGL for the task you ask about, because that's not in its job description.
Anyway, you can use transform feedback (available only in the more recent versions of OpenGL, starting with version 4.0) to retrieve the data you're interested in. See http://www.opengl.org/wiki/Transform_Feedback for more information.
Upvotes: 0