OpenGL Super Bible! Page 441 Table 12-1 Texture (Web hosting providers)

December 14th, 2007

OpenGL Super Bible! Page 441 Table 12-1 Texture Image Filters Filter Description GL_NEAREST Nearest-neighbor filtering. GL_LINEAR Linear interpolation. GL_NEAREST_MIPMAP_NEAREST Nearest-neighbor mipmapped filtering. GL_NEAREST_MIPMAP_LINEAR Linear interpolated mipmaps. GL_LINEAR_MIPMAP_NEAREST Linear interpolation of mipmaps. Linear interpolation of interpolated GL_LINEAR_MIPMAP_LINEAR mipmaps. GL_NEAREST filtering takes the closest pixel in the texture image rather than interpolating between pixels. You ll learn more about mipmap filtering later in the chapter. Defining 2D Textures To define a 2D texture image in OpenGL, you call glTexImage2D. The glTexImage2D function takes a height argument in addition to the ones that glTexImage1D uses, as follows: void glTexImage2D(GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) Like glTexImage1D, the width and height arguments must be a power of 2. Listing 12-2 shows how to load a sky texture image complete with clouds. Listing 12-2 Defining a 2D texure image void LoadAllTextures(void) { BITMAPINFO *info; /* Bitmap information */ void *bits; /* Bitmap pixel bits */ GLubyte *rgb; /* Bitmap RGB p ixels */ /* * Try loading the bitmap and converting it to RGB */
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Web design - Page 440 OpenGL Super Bible! The width parameter

December 13th, 2007

Page 440 OpenGL Super Bible! The width parameter specifies the width of the main texture image (without the border pixels) and must be a power of 2. The format argument indicates the type of color values to expect GL_COLOR_INDEX, GL_LUMINANCE, GL_RGB, or GL_RGBA. You ll find an example of defining a 1D texture in Listing 12-1 and in the example code CH12TEX1D.C on the source code CD-ROM. Listing 12-1 Defining a 1D texture image void LoadAllTextures(void) { static unsigned char roygbiv_image[8][3] = { { 0×3f, 0×00, 0×3f }, /* Dark Violet (for 8 colors ) */ { 0×7f, 0×00, 0×7f }, /* Violet */ { 0xbf, 0×00, 0xbf }, /* Indigo */ { 0×00, 0×00, 0xff }, /* Blue */ { 0×00, 0xff, 0×00 }, /* Green */ { 0xff, 0xff, 0×00 }, /* Yellow */ { 0xff, 0×7f, 0×00 }, /* Orange */ { 0xff, 0×00, 0×00 } /* Red */ }; glNewList(RainbowTexture = glGenLists(1), GL_COMPILE); glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage1D(GL_TEXTURE_1D, 0, 3, 8, 0, GL_RGB, GL_UNSIGNED_BYTE, roygbiv_image); glEndList(); } The example code creates a display list containing the texture image and the desired magnification and minification filter, GL_LINEAR. The minification filter is used when the polygon to be drawn is smaller than the texture image, in this case 8 pixels. The magnification filter is used when the polygon is larger than the texture image. By designating the GL_LINEAR filter, you tell OpenGL to linearly interpolate color values in the texture image before drawing anything on the screen. The other filters you can use for GL_TEXTURE_MIN_FILTER are listed in Table 12-1.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

OpenGL Super Bible! Page 439 The 1D and (Web hosting packages)

December 12th, 2007

OpenGL Super Bible! Page 439 The 1D and 2D textures you ve seen so far are composed of RGB color values. Textures can also be composed of color indices or luminance (gray) levels, and can include alpha (transparency) values. The latter is useful for defining natural objects such as trees, because the alpha value can be used to make the tree visible but let the background show through. You ll learn more about this in Chapter 16. Some hardware also supports 3D (volume) textures with OpenGL. Volume textures are used for viewing CAT, MRI, and other 3D scans. Unfortunately, even a small 256 x 256 x 256 grayscale texture image will need a whopping 16 MB of memory. Currently an extension to OpenGL, 3D texturing may be included as a required feature in the OpenGL 1.1 specification. Defining Texture Images Naturally, you must define a texture image before you can draw textured polygons in OpenGL. Texture images follow the same storage rules as bitmaps (discussed in Chapter 11). A Note About Texture Images: The OpenGL standard requires that texture images dimensions must be a power of 2. Texture images can also have 1 or 2 border pixels around their edges to define the color of polygons that fall outside the texture image. Defining 1D Textures OpenGL provides a single function for defining 1D textures: glTexImage1D. The glTexImage1D function accepts eight arguments: void glTexImage1D(GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) The target argument specifies which texture should be defined; this argument must be GL_TEXTURE_1D. The level argument indicates the texture image s level of detail and is usually 0. Other values are used for mipmapped textures (described later in this chapter). The components argument specifies the number of color values used for each pixel. For color index textures, components must be 1. Values of 3 and 4 are used for RGB and RGBA texture images, respectively. Width and border specify the size of the texture image. The border value controls the number of border pixels OpenGL should expect (and use) and may have a value of 0, 1, or 2.
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.

My web site - Page 438 OpenGL Super Bible! Indigo, Violet) texture

December 11th, 2007

Page 438 OpenGL Super Bible! Indigo, Violet) texture to display a rainbow. The texture image is a line of pixels (color values) covering the color spectrum seen in a rainbow. The equivalent nontextured scene would contain seven times the polygons of the textured one and require much more rendering time. Figure 12-1 A 1D textured rainbow A 2D texture is an image that is more than 1 pixel wide and high and is generally loaded from a Windows .BMP file. Two-dimensional textures are commonly used to replace complex surface geometry (lots of polygons) on buildings, trees, and so forth. These 2D textures can also be used to add realistic background details, like the clouds in the sky in Figure 12-2. Figure 12-2 A 2D sky texture and the resulting scene
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

OpenGL Super Bible! (Photoshop web design) Page 437 Chapter 12 Texture

December 10th, 2007

OpenGL Super Bible! Page 437 Chapter 12 Texture Mapping What you ll learn in this chapter: How to Functions You ll Use Drape images onto polygons (texture mapping) glTexImage1D/glTexImage2D Use .BMP files as textures TextureLoadBitmap/TextureLoadMipmapy Use automatic texture coordinate generation glTexGen Texture mapping is probably the most significant advance in computer graphics in the last ten years. OpenGL provides texture image mapping functions that fit images onto polygons in your scene. How those images are put onto the polygons is up to you. Texture mapping is used in games, including DOOM, for realistic images of rooms and monsters. Unlike OpenGL, these games use a texturing method called raycasting to map texture images onto polygons. Though raycasting is much faster on standard graphics cards than the texture mapping provided by OpenGL, it is also limited to flat surfaces in a 2D plane. That is, you can t look up or down. Texture mapping in OpenGL doesn t have this limitation, but you can expect it to work more slowly on standard graphics cards. The good news is that some newer, affordable 3D graphics cards support OpenGL and hardware texturing. When a board supports hardware texture mapping, your CPU doesn t have to do all the texture mapping calculations and preparation the graphics card does it for you. The examples in this chapter will run on any Windows-compatible graphics card. If your graphics card supports 16-or 24-bit true color displays, you ll want to use them. Besides better-looking scenes, you ll find that the 16- and 24-bit modes are actually faster. The Basics of Texture Mapping Texture mapping in OpenGL is fairly straightforward. To begin with, every texture is an image of some sort. A 1D texture is an image with width but no height, or vise versa; 1D textures are a single pixel wide or high. You might think that 1D textures aren t very useful, but in fact they can take the place of more conventional color-shading techniques and accelerate rendering in the process! Figure 12-1 shows a 1D ROY- G-BIV (Red, Orange, Yellow -Green -Blue,
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Page 436 OpenGL Super Bible! GL_BYTE Signed 8-bit

December 9th, 2007

Page 436 OpenGL Super Bible! GL_BYTE Signed 8-bit values ( 128 to 127) GL_UNSIGNED_BYTE Unsigned 8-bit values (0 to 255) GL_BITMAP Bitmap image (0 to 1) GL_SHORT Signed 16-bit values ( 32768 to 32767) GL_UNSIGNED_SHORT Unsigned 16-bit values (0 to 65535) GL_INT Signed 32-bit values ( 2147483648 to 2147483647) GL_UNSIGNED_INT Unsigned 32-bit values (0 to 4294967295) GL_FLOAT 32-bit floating point values (GLfloat) pixels Glvoid *: A pointer to the pixel data for the image. Returns None. Known Bugs The GL_PACK_ALIGNMENT parameter for glPixelStore is presently ignored by glReadPixels. Example See the example in CH11BITMAP.C. See Also glPixelMap, glPixelStore, glPixelTransfer
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

OpenGL Super Bible! Page 435 glReadPixels Purpose Reads

December 8th, 2007

OpenGL Super Bible! Page 435 glReadPixels Purpose Reads a block of pixels from the framebuffer. Include File Syntax void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const Glvoid *pixels); Description This function copies pixel data from the framebuffer to memory. Besides the format and type arguments, several other parameters define the encoding of pixel data in memory and control the processing of the pixel data before it is placed in the memory buffer. See the references for glPixelMap, glPixelStore, glPixelTransfer. Parameters GLint: The lower-left corner window horizontal coordinate. y GLint: The lower-left corner window vertical coordinate. width GLsizei: The width of the image in pixels. height GLsizei: The height of the image in pixels. format GLenum: The colorspace of the pixels to be read. Valid formats are as follows: GL_COLOR_INDEX Color index pixels GL_LUMINANCE Grayscale pixels GL_LUMINANCE_ALPHA Grayscale + alpha pixels (2 components) GL_RGB RGB pixels (3 components) GL_RGBA RGBA pixels (4 components) GL_RED Red pixels GL_GREEN Green pixels GL_BLUE Blue pixels GL_ALPHA Alpha pixels GL_STENCIL_INDEX Stencil buffer values GL_DEPTH_COMPONENT Depth buffer values type Glenum: The data type of the pixels to be drawn. Valid types are as follows:
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Page 434 OpenGL Super Bible! (Web hosting) glPixelZoom Purpose Sets

December 7th, 2007

Page 434 OpenGL Super Bible! glPixelZoom Purpose Sets the scaling for pixel transfers. Include File Syntax void glPixelZoom(GLfloat xfactor, GLfloat yfactor); Description This function sets pixel scaling for glCopyPixels, glDrawPixels, glReadPixels, glTexImage1D, and glTexImage2D. Pixels are scaled using the nearest neighbor algorithm when they are read from memory or the framebuffer. In the case of glCopyPixels and glDrawPixels, the scaled pixels are drawn in the framebuffer at the current raster position. For glReadPixels, pixels are written to the supplied memory buffer. When reading a zoomed image, you should compute the image size as follows: int new_width, new_height; int width, height; new_width = xfactor * width + 0.5; new_height = yfactor * height + 0.5; Parameters xfactor GLfloat: The horizontal scalingfactor (1.0 is no scaling). yfactor GLfloat: The vertical scaling factor (1.0 is no scaling). Returns None. Example See the example in CH11OGLVIEW.C. See Also glCopyPixels, glDrawPixels, glReadPixels, glTexImage1D, glTexImage2D
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Web design course - OpenGL Super Bible! Page 433 GL_ALPHA_SCALE Specifies a

December 6th, 2007

OpenGL Super Bible! Page 433 GL_ALPHA_SCALE Specifies a floating point scaling factor for alpha color values. GL_ALPHA_BIAS Specifies a bias that is added to every alpha color value. GL_DEPTH_SCALE Specifies a floating point scaling factor for depth values. GL_DEPTH_BIAS Specifies a bias that is added to every depth value. param GLint, GLfloat: The parameter value. Returns None. Example See the example in CH11OGLVIEW.C. See Also glCopyPixels, glDrawPixels, glPixelMap, glReadPixels, glTexImage1D, glTexImage2D
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Web hosting providers - Page 432 OpenGL Super Bible! glPixelTransfer Purpose Sets

December 5th, 2007

Page 432 OpenGL Super Bible! glPixelTransfer Purpose Sets pixel transfer modes and options for glCopyPixels, glDrawPixels, glReadPixels, glTexImage1D, and glTexImage2D Include File Syntax void glPixelTransferi(GLenum pname, GLint param);void glPixelTransferf(GLenum pname, GLfloat param); Description This function sets pixel transfer modes and options for glCopyPixels, glDrawPixels, glReadPixels, glTexImage1D, and glTexImage2D. Parameters pname GLenum: The transfer parameter to set. Valid names are as follows: GL_MAP_COLOR When set to GL_TRUE, enables pixel maps defined with glPixelMap for color indices and RGBA values. GL_MAP_STENCIL When set to GL_TRUE, enables pixel maps defined with glPixelMap for stencil values. GL_INDEX_SHIFT Specifies the amount to bitshift color indices. Positive values shift indices to the left. Negative values shift indices to the right. GL_INDEX_OFFSET Specifies an offset to be added to every color index. GL_RED_SCALE Specifies a floating point scaling factor for red color values. GL_RED_BIAS Specifies a bias that is added to every red color value. GL_GREEN_SCALE Specifies a floating point scaling factor for green color values. GL_GREEN_BIAS Specifies a bias that is added to every green color value. GL_BLUE_SCALE Specifies a floating point scaling factor for blue color values. GL_BLUE_BIAS Specifies a bias that is added to every blue color value.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.