OpenGL vectors

Started by
0 comments, last by Nychold 18 years, 7 months ago
Is it possible to get the hWnd or hDC of an OpenGL app and dump the vectors used to render an object? Thanks, Damon
Advertisement
Most definitely, it's possible to get AN hDC from a Window which already exists. If you're clever and know how to use ReadProcessMemory, you can get THE hDC and probably hRC for a Window. However, to get access to the vectors necessary for drawing to the screen, I would say, is damn near impossible. Especially if it's not your code. In fact, that'd probably be a form of stealing. ;)

If it is your code, then yes, it's quite easy to get all the vectors which OpenGL draws to the screen:

// inside your render codeglGetFloatv(GL_MODELVIEW_MATRIX,&modelView);glGetFloatv(GL_PROJECTION_MATRIX,&projection);// modelView of projection// you'll need to write this functionmatrixMultiply(&projection,&modelView,&transformation);// Assuming all your vectors to be drawn are in vectors[]vectorTransform(&transformation,&vector,&outVector);


And voila. outVector contains all of the final vectors. Or at least it should, if I did my math right. Either way, the principle is the same.

This topic is closed to new replies.

Advertisement