Archive for July, 2007

Page 300 OpenGL Super Bible! glIndex Purpose Sets (Free web hosting with ftp)

Tuesday, July 31st, 2007

Page 300 OpenGL Super Bible! glIndex Purpose Sets the current color index to be used for color operations. Include File Variations void glIndexd(GLdouble c); void glIndexf(GLfloat c); void glIndexi(GLint c); void glIndexs(GLshort c); void glIndexdv(const GLdouble *c); void glIndexfv(const GLfloat *c); void glIndexiv(const GLint *c); void glIndexsv(const GLshort *c); Description This function changes the current color index to the one specified by c. This indexvalue is maintained internally as a floating point number. Parameters The new color index to use for all subsequent operations. *cA pointer to the new color index to use for all subsequent operations. Returns None. Example The following code from the sample program INDEX draws a smoothly shaded triangle. The top of the triangle is set to color index 0 which has been set to zero, and the bottom corners to color index 255 which has been set to bright red. // Draw the triangle glBegin(GL_TRIANGLES); // Darkest Red Apex (black) glIndexi(0); glVertex3f(0.0f,200.0f,0.0f); // Brightest red bottom corners glIndexi(255); glVertex3f(200.0f,-70.0f,0.0f); glVertex3f(-200.0f, -70.0f, 0.0f); glEnd(); See Also glColor
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

OpenGL Super Bible! Page 299 glColorMask Purpose Enables (Dedicated web hosting)

Tuesday, July 31st, 2007

OpenGL Super Bible! Page 299 glColorMask Purpose Enables or disables modification of color components in the color buffers. Include File Syntax void glColorMask(GLboolean bRed, GLboolean bGreen, GLboolean bBlue, GLboolean bAlpha); Description This function allows changes to individual color components in the color buffer to be disabled or enabled (all are enabled by default). For example, setting the bAlpha argument to GL_FALSE disallows changes to the alpha color component. Parameters bRed GLboolean: Specifies whether the red component may be modified. bGreen GLboolean: Specifies whether the green component may be modified. bBlue GLboolean: Specifies whether the blue component may be modified. bAlpha GLboolean: Specifies whether the alpha component may be modified. Returns None. Example See the sample program MASK on the CD for this chapter. See Also glColor, glIndex, glIndexMask, glDepthMask, glStencilMask
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Web site domain - Page 298 OpenGL Super Bible! Each element in

Tuesday, July 31st, 2007

Page 298 OpenGL Super Bible! Each element in the array must be of the same type. When the alpha component is not specified, it is implicitly set to 1.0. When non-floating point types are specified, the range from zero to the largest value represented by that type is mapped to the floating point range 0.0 to 1.0. Parameters red Specifies the red component of the color. green Specifies the green component of the color. blue Specifies the blue component of the color. alpha Specifies the alpha component of the color. Used only in variations that take four arguments. *v A pointer to an array of red, green, blue, and possibly alpha values. Returns None. Example The following code from the CCUBE example in this chapter sets one of the corners of the color cube to white. // Front face glBegin(GL_POLYGON); // White glColor3ub((GLubyte) 255, (GLubyte)255, (GLubyte)255); glVertex3f(50.0f,50.0f,50.0f); See Also glIndex
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.

OpenGL Super Bible! Page 297 glColor Purpose Sets (Web design course)

Monday, July 30th, 2007

OpenGL Super Bible! Page 297 glColor Purpose Sets the current color when in RGBA color mode. Include File Variations void glColor3b(GLbyte red,GLbyte green, GLbyte blue); void glColor3d(GLdouble red, GLdouble green, GLdouble blue); void glColor3f(GLfloat red, GLfloat green, GLfloat blue); void glColor3i(GLint red, GLint green, GLint blue); void glColor3s(GLshort red, GLshort green, GLshort blue); void glColor3ub(GLubyte red, GLubyte green, GLubyte blue); void glColor3ui(GLuint red, GLuint green, GLuint blue); void glColor3us(GLushort red, GLushort green, GLushort blue); void glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); void glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); void glColor4i(GLint red, GLint green, GLint blue, GLint alpha); void glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha); void glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); void glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha); void glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha); void glColor3bv(const GLbyte *v); void glColor3dv(const GLdouble *v); void glColor3fv(const GLfloat *v); void glColor3iv(const GLint *v); void glColor3sv(const GLshort *v); void glColor3ubv(const GLubyte *v); void glColor3uiv(const GLuint *v); void glColor3usv(const GLushort *v); void glColor4bv(const GLbyte *v); void glColor4dv(const GLdouble *v); void glColor4fv(const GLfloat *v); void glColor4iv(const GLint *v); void glColor4sv(const GLshort *v); void glColor4ubv(const GLubyte *v); void glColor4uiv(const GLuint *v); void glColor4usv(const GLushort *v); Description This function sets the current color by specifying separate red, green, and blue components of the color. Some functions also accept an alpha component. Each component represents the range of intensity from zero (0.0) to full intensity (1.0). Functions with the v suffix take a pointer to an array that specifies the components.
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Page 296 OpenGL Super Bible! Reference Section glClearIndex (Email web hosting)

Monday, July 30th, 2007

Page 296 OpenGL Super Bible! Reference Section glClearIndex Purpose Sets the clear value for the color index buffers. Include File Syntax void glClearIndex(GLfloat color); Description This function specifies the color index to use in color index mode to clear the color buffers. This has the net effect of clearing the window and setting the background color to the color in the index specified by the color parameter. Parameters color GLfloat: The value to use when the color index buffers are cleared with glClear. The default is 0. Returns None. Example See the sample program INDEX in this chapter. See Also glClear, glGet
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.

OpenGL Super Bible! Page 295 Summary This chapter (Make my own web site)

Sunday, July 29th, 2007

OpenGL Super Bible! Page 295 Summary This chapter covers one of the most important features supported by a graphics package: color. You have seen how to specify a color in terms of its RGB components, and how these components relate to one another in the RGB color cube. Your understanding of glColor has been expanded to include the coloring of vertices, and you have seen how this affects shading. We explained OpenGL s selection of colors in 4-, 8-, 16-, and 24-bit Windows color modes. We demonstrated the building of a 3-3-2 palette for use by OpenGL in 8-bit color modes. Finally, we took a brief look at color index mode and its utilization to gain better palette control in 8-bit color modes. Good use of color and shading is a prerequisite for good 3D graphics. The upcoming chapter explains how OpenGL uses shading to produce lighting effects. You ll learn how to specify material colors and lighting conditions and allow OpenGL to select the drawing colors.
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Page 294 OpenGL Super Bible! Notice (Web site designers) that this

Saturday, July 28th, 2007

Page 294 OpenGL Super Bible! Notice that this code always returns a palette. No check is made to see if the pixel format required a palette. This is because you can use color index mode even in the high-color modes. All of the other code concerning palette realization remains unaffected. Show the Triangle Now the code to render the triangle sets the color of the triangle s apex to color index 0, which is the darkest entry in the palette with 0 intensity (black). The color for the bottom two corners is set to palette index 255, the brightest shade of red. With smooth shading enabled, this code (Listing 8-7) produces the triangle seen in Figure 8-15. Listing 8-7 Code to render the shaded triangle in the INDEX program void RenderScene(void) { // Clear the window with current clearing color glClear(GL_COLOR_BUFFER_BIT); // Enable smooth shading glShadeModel(GL_SMOOTH); // Draw the triangle glBegin(GL_TRIANGLES); // Darkest Red Apex (black) glIndexi(0); glVertex3f(0.0f,200.0f,0.0f); // Brightest red bottom corners glIndexi(255); glVertex3f(200.0f,-70.0f,0.0f); glVertex3f(-200.0f, -70.0f, 0.0f); glEnd(); // Flush drawing commands glFlush(); }
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

OpenGL Super Bible! Page 293 Using Color Index (Web host)

Saturday, July 28th, 2007

OpenGL Super Bible! Page 293 Using Color Index Mode To specify color index mode, all you need to do is set the iPixelType member of the PIXELFORMATDESCRIPTOR to PFD_TYPE_COLORINDEX. First, though, you need to create a palette. With color index mode, the palette is specific to the application. For our INDEX sample program, we want a palette consisting only of shades of red to do very smooth shading in an 8-bit color mode. Listing 8-6 is the code to create this palette. Listing 8-6 Code to create a palette consisting only of shades of red // Creates a color ramp from black to bright red HPALETTE GetRedPalette(HDC hDC) { HPALETTE hRetPal = NULL; // Handle to palette to be created LOGPALETTE *pPal; // Pointer to memory for logical palette int i; // Counting variable // Allocate space for a logical palette structure plus all the palette // entries pPal = {LOGPALETTE*)malloc(sizeof(LOGPALETTE)+256*sizeof(PALETTEENTRY)); // Fill in palette header pPal->palVersion = 0×300;// Windows 3.0 pPal- >palNumEntries = 256;// table size // Loop through all the palette entries, creating a graduated red // palette containing only shades of red for(i = 10; i < 246; i++) { pPal->palPalEntry[i].peRed = i;// Red intensity from 0 to 255 pPal- >palPalEntry[i].peGreen = 0; pPal->palPalEntry[i].peBlue = 0; pPal- >palPalEntry[i].peFlags = (unsigned char) NULL; } // Create the palette hRetPal = CreatePalette(pPal); // Go ahead and select and realize the palette for this device context SelectPalette(hDC,hRetPal,FALSE); RealizePalette(hDC); // Free the memory used for the logical palette structure free(pPal); // Return the handle to the new palette return hRetPal; }
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

Web design conference - Page 292 OpenGL Super Bible! devices that support

Friday, July 27th, 2007

Page 292 OpenGL Super Bible! devices that support palettes (8-bit display cards). This doesn t mean you can t use color index mode on these devices; it only means there is no corresponding hardware palette with which you can perform animation. Palette animation occurs when you change the entries in the palette, which causes a corresponding change in all screen pixels having that palette index. This can produce color cycling for some special effects. Another reason to use color index mode is for applications that use color to indicate a third dimension to indicate the pressure at certain spatialregions, for instance. You can also use this mode for false color images that do not require an organized palette. Finally, color index mode can be somewhat faster in 8-bit color modes because only one color channel (as opposed to three, one each for red, green, and blue) needs to be manipulated instead of three. In addition to limiting the color selection, color index mode does not support some of OpenGL s other special effects including many lighting effects and shading, fog, anti- aliasing, and alpha blending. Generally, it is better to use RGBA mode. As mentioned, the most significant advantage of using color index mode is for more palette control on 8-bit display devices. The 3-3-2 palette limits your color choices, and if you want 200 shades of red to do really smooth shading on an 8-bit display, you are out of luck. In color index mode, however, the palette entries range from darkest to lightest colors. You can separate the palette into as many or as few bands as you like. The INDEX sample program displays a triangle shaded from black to bright red (see Figure 8-15). This shading is not possible in 8-bit color mode using at 3-3-2 palette. Figure 8-15 Output from INDEX showing over 200 shades of red for smooth shading
If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.

OpenGL Super (Medical web site) Bible! Page 291 // Window is

Friday, July 27th, 2007

OpenGL Super Bible! Page 291 // Window is being destroyed, cleanup case WM_DESTROY: // Deselect the current rendering context and delete it wglMakeCurrent(hDC,NULL); wglDeleteContext(hRC); // If a palette was created, destroy it here if(hPalette != NULL) DeleteObject(hPalette); // Tell the application to terminate after the window // is gone. PostQuitMessage(0); break; Some Restrictions Apply Not all of your 256 palette entries will actually be mapped to the system palette. Windows reserves 20 entries for static system colors that include the standard 16 VGA/EGA colors. This protects the standard windows components (title bars, buttons, etc.) from alteration whenever an application changes the system palette. When your application realizes its palette, these 20 colors will not be overwritten. Fortunately, some of these colors already exist or are closely matched in the 3-3-2 palette. Those that don t are closely enough matched that you shouldn t be able to tell the difference. Color Index Mode OpenGL also supports the alternative color index mode. In this mode, you specify a color for drawing operations by specifying an index into an array of colors, rather than as an RGB triplet. You cannot use color index mode and RGBA color mode together. This means if you use color index mode on a true-color device (or near true-color, such as a 16- bit color card), you won t have access to all the available colors. Under some implementations, the color index palette can be up to 4,096 entries long. The Microsoft implementation however, only supports 256 entries. You can use color index mode to do contour mapping in which some function of the surface returns an index into the palette. It is somewhat faster than RGBA, and the limitations of the 3-3-2 palette do not exist. For example, if you need 200 shades of gray, you can have them. However, some of the lighting effects discussed in the next chapter are not available under color index mode either. Why Use Color Index Mode? There are really very few good reasons to use color index mode. Typically, this mode is used to get more control over the palette. You can also do palette animation, but only on
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.