Starting a web site - OpenGL Super Bible! Page 447 To make your

OpenGL Super Bible! Page 447 To make your life a bit easier, the OpenGL utility library (GLU32.LIB) provides two functions that automatically generate mipmapped images based on a single, high-resolution texture. In the following code, the gluBuild1DMipmaps and gluBuild2DMipmaps functions take the place of glTexImage1D and glTexImage2D: /* 1D texture */ glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR); gluBuild1DMipmaps(GL_TEXTURE_1D, 3, 8, 0, GL_RGB, GL_UNSIGNED_BYTE, roygbiv_image); /* 2D texture */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, info->bmiHeader.biWidth, info- >bmiHeader.biHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, rgb); Because the gluBuild1DMipmaps and gluBuild2DMipmaps functions create images from one image, the appearance of some textured images may not be accurate. It s like drawing text characters at different sizes scaling the bitmaps doesn t always generate good-looking results! When you run into this sort of problem, generate your mipmap images manually. A Terrain Viewing Program Our project for this chapter is a terrain viewing program that takes advantage of some of the texture-mapping features we have discussed. With this program, we ll want to accomplish the following: View textured terrain scenes Edit the terrain interactively in 3D Fly through the terrain Print the current scene Save the current scene to a .BMP file The entire terrain program is listed at the end of this chapter, just before the Reference Section. A copy of the program is in the CH12 source directory on your CD-ROM. Double- click on the TEXSCENE.EXE program icon to try it out!
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Leave a Reply