Java Programing

February 1, 2007

Using the EYE_LINEARmode allows you to define a

Filed under: Java 3D Programming — webmaster @ 5:35 am

Figure 14.10 Using SPHERE_MAP texture coordinate generation. Instead of the texture image being used to denote contour lines on the landscape, the landscape can now be considered to be a reflective surface within a spherical room that has the texture image applied as wallpaper to its inner walls Figure 14.11 Texture image used for SPHERE_MAP texture coordinate generation Conclusions Dynamic texture mapping is a very powerful mechanism for applications that can define a relatively simple mathematical relationship between vertex and texture coordinates. The SPHERE_MAPmode is useful for creating some special effects for the objects within your scene. All three texture generation options can be confusing and are certainly more complex than simply using 243

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services

Using the EYE_LINEARmode allows you to define a

Filed under: Java 3D Programming — webmaster @ 5:35 am

Using the EYE_LINEARmode allows you to define a field of texture coordinates that can produce dynamic contour lines on moving objects. Figure 14.9 Using EYE_LINEAR texture coordinate generation. As the landscape is translated upward in the y axis, the texture coordinates change, resulting in a different frame. In the left-hand frame, only the peaks of the landscape are above the y = 0 plane; the rest of the landscape is either texture mapped with the water section of the texture image or does not have any texture applied since the calculated texture coordinate is less than 0.0. In the right-hand frame, most of the landscape is above the y = 0 plane, and only the deepest hollows in the landscape are textured using the water section of the texture image SPHERE_MAP mode The SPHERE_MAPmode is very different from the OBJECT_LINEARor EYE_LINEARmodes in that it always generates 2D (s,t) texture coordinates irrespective of any mapping planes passed to the TexCoordGenerationconstructor. The SPHERE_MAPmode calculates texture coordinates based on the vector passing from the origin (in world coordinates) to a vertex. It creates a mapping that essentially paints an environment map onto the face of an object. Imagine that the object was a reflective sphere positioned in the center of a room. If the SPHERE_MAP texture coordinate generation mode was used, the sphere would appear to reflex the items within the room. By precomputing a spherical texture map using a ray-tracing program and using the SPHERE_MAPtexture mode, a photorealistic reflective object can be created. Please refer to the OpenGL 1.1 NOTE Specification for the mathematical details of how the texture coordinates are calculated from the vector passing from the origin to each vertex. Because the SPHERE_MAPmode always generates both s and t coordinates, we have to create a texture image to achieve the effect in figure 14.10. This texture image is shown in figure 14.11. However, because both the TexCoordTestexample in EYE_LINEARand OBJECT_LINEARmodes only use the t = 0 row of the image, their results are unchanged. 242

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services

« Previous Page

Powered by Java Web Hosting