PDA

View Full Version : Zooming/Magnify



plastichead
07-18-2001, 11:17 PM
I have a Question about zooming. I use OpenGL for 2d currently. How can I zoom/magnify the things? I mean pixels, like in gimp or photoshop with the zoom tool. So when I zoom by the factor of 2, all pixels should be twice as large. I do not use glDrawPixels(), because I need to translate/rotate images, lines etc.

plastichead.

citizen
07-19-2001, 02:24 AM
Did you try glPointSize()?

[This message has been edited by citizen (edited 07-19-2001).]

jxruan
07-19-2001, 05:08 AM
It depends on what you want.
If you want your image still be straightly faced to you after the rotation, you must use Raster mothod to display your image. And the zooming effect can be achieved by glPixelZoom(xScale, yScale).
If you want the outlook of your image be conformed with the rotation, you actually need 3D rendering. Here you must use texture machanism to map your image on to a QUAD. The rotation and zooming of your image therefore is by performing the same operations on the QUAD.



[This message has been edited by jxruan (edited 07-19-2001).]

plastichead
07-26-2001, 06:55 AM
(Back from vacation). glPointSize() only magnifies points drawn with GL_POINT.
Yes, I need to keep rotation etc. Because I also draw lines and not only images (I draw them with textures, glDrawPixels() is slow), I can't simply solve the problem with letting opengl zooming the texture.
Yes, I could draw all the things to a texture and use it with a doubly sized QUAD.
I also thought about drawing the things to the backbuffer and then copy a smaller part of the backbuffer to the whole frontbuffer with glCopyPixels() and glPixelZoom().
Any suggestions?