Jump to content
  • Advertisement
Sign in to follow this  
dhack

OpenGL OpenGL vectors

This topic is 4813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to get the hWnd or hDC of an OpenGL app and dump the vectors used to render an object? Thanks, Damon

Share this post


Link to post
Share on other sites
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 code
glGetFloatv(GL_MODELVIEW_MATRIX,&modelView);
glGetFloatv(GL_PROJECTION_MATRIX,&projection);

// modelView of projection
// you'll need to write this function
matrixMultiply(&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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!