PDA

View Full Version : Zoom in on loaded texture with mouse click?



GrimmBro
02-12-2011, 08:28 AM
Hi there, I'm trying to zoom in on a loaded texture with a mouse click. Would it be glPixelZoom I use for this? If so where about would I implement it within my cube program? If I'm completely wrong about this could someone give me a better indication of where to start looking.

ZbuffeR
02-12-2011, 11:23 AM
Easiest is to render a textured quad, then scale the quad to zoom.

GrimmBro
02-12-2011, 06:07 PM
Thanks for the reply; managed to do what you suggested but it doesn't give me the required effect unfortunately. Is there any functionality in OpenGL that could magnify the texture alone on the side of the cube without resizing the cube; perhaps even to specific coordinates of the texture? Perhaps I am approaching this the wrong way; any more help would be appreciated.

Alfonse Reinheart
02-12-2011, 06:41 PM
Is there any functionality in OpenGL that could magnify the texture alone on the side of the cube without resizing the cube; perhaps even to specific coordinates of the texture?

You mean like the texture coordinates you put on the cube?

MaxH
02-12-2011, 11:00 PM
Is there any functionality in OpenGL that could magnify the texture alone on the side of the cube without resizing the cube
Sounds like you simply need to scale the texture coordinates.
Use glMatrixMode(GL_TEXTURE) and glScale.

GrimmBro
02-13-2011, 10:16 AM
Sounds like you simply need to scale the texture coordinates.
Use glMatrixMode(GL_TEXTURE) and glScale.

That's the one; thanks for the help.