Java Reference
In-Depth Information
Chapter V
Textures
IntroductIon
Although extensive use of basic attributes such as color and material will be able to make
an object realistic to the human user, it will be time consuming to develop the code for
objects that have complicated geometries or appearances. As an example, to create an object
with many color patterns on, say, a curve surface, many zones or strips may need to be
individually defined using the appropriate color or material properties. To save program-
ming effort, Java 3D allows the use of what is known as texturing and image mapping,
which will be the concern of this chapter.
Specifically, there are four ways to apply colors to a visual object in Java 3D. The first
one is to apply color by defining the color of each vertex in the associated geometry object
introduced in Chapter III. Another two ways are to use the coloring attributes in an ap-
pearance object and use a material object explained in Chapter IV. Alternatively, as will
be discussed in this chapter, we can also apply textures.
Texturing is a simple method of giving a geometrical object a realistic appearance.
While a desert landscape can be created by simply setting the coloring attribute to golden
brown, the result will be dull and unrealistic. However, by using a file with a digital photo
for a real desert and applying this on top of the desert geometry, a realistic desert can be
constructed in the virtual 3D world (Seamless textures pack, 2006).
With texturing, we have new means to add visual details without the need to have ad-
ditional geometries. The image used for texturing is mapped on to the object at rendering
Search WWH ::




Custom Search