JavaScript EditorFree JavaScript Editor     Ajax Editor 



Main Page
Previous Page
Next Page

19.1. Geometric Image Transforms

As part of its fixed functionality, OpenGL defines only one operation that modifies the geometric properties of an image: pixel zoom. This operation scales an image as it is sent to the display.

If you want to rotate an image, the traditional response has always been "Load the image into texture memory, use it to draw a textured rectangle, and transform the rectangle." Although this approach does require an extra read and write of the image within the graphics systemthe image must be written into texture memory and then read as the rectangle is drawnthe speed and bandwidth of today's graphics accelerators make this an acceptable approach for all but the most demanding applications. With the OpenGL Shading Language, you can even provide the same rectangle coordinates every time you draw the image and let the vertex shader do the scaling, translation, or rotation of the rectangle. You can perform image warping by texturing a polygon mesh instead of a single rectangle. Hardware support for texture filtering can produce high-quality results for any of these operations.


Previous Page
Next Page




JavaScript EditorAjax Editor     JavaScript Editor