Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BradDaBug

gluUnProject and blitting

This topic is 5738 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

I wrote a little blitter function in OpenGL using gluUnProject to translate the screen coords into world coords. It worked fine, until I started moving the camera around. Now it doesn''t work. If I do a glPushMatrix() glLoadIdentity() ... blit blit blit... glPopMatrix() it sort of works, except it puts the quad of whatever''s blitted in really wierd places. What''s wrong? What do I do?

Share this post


Link to post
Share on other sites
Advertisement
nO THATS A BAD IDEA. USE AN ORTHOGRAPHIC MATRIX, THEN DRAW QUADS. LOOK IT UP ELSEWHERE, THERE''S LOTS OF TUTORIALS.

EG.

glOrtho(.....)
glMatrixMode(GL_MODELVIEW)
glPushMatrix();

bind texture,

draw quads->screen coords

glPopMatrix();

that''s the best way to blit, OR you could use glDrawPixels

Share this post


Link to post
Share on other sites
are you making sure that your glGetDouble() calls to aquire the current transformations used in gluUnproject are made between your push and pop calls for your camera?

Share this post


Link to post
Share on other sites

  • 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!