OpenGL Super Bible! Page 453 void glTexGeniv(GLenum coord, (Web hosting providers)

OpenGL Super Bible! Page 453 void glTexGeniv(GLenum coord, GLenum pname, GLint *params) where the coord parameter specifies which texture image coordinate to generate, GL_S or GL_T, and the pname parameter specifies the vector to define; in this case GL_OBJECT_PLANE. Finally, the params array specifies the object plane vector that is used to compute the texture coordinate. The previous code for our terrain would generate these coordinates: S = 2 * X T = 2 * Z To make OpenGL use these generated coordinates, you must enable texture coordinate generation, as follows: glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); The file TEXSCENE.C contains a version of our terrain viewing program that uses generated texture coordinates. The same techniques can be used with a 1D texture image. For the 1D image, you d probably generate the S coordinate from the height (Y) to color the terrain based upon the height of the terrain. Generating texture coordinates is usually faster than specifying them manually in immediate mode, but is slower when using display lists. Flying Through the Terrain When the user is flying through the terrain, we need to regulate the flying speed based on the update rate of our scene. Rather than trying to maintain a fixed update rate which can vary depending on the graphics card and CPU being used we will measure the elapsed time from the last update to the current time. The FlyTerrain function manages this by measuring the time in milliseconds between each call, and moving the viewer forward at a fixed speed relative to the elapsed time.
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Leave a Reply