Java Reference
In-Depth Information
Figure 3. Specifying texture coordinates with distortion for a triangular geometry object
1.
Point2f q = new Point2f( 0.5f, 1.3f);
2.
plane.setTextureCoordinate(0, q);
3.
q.set(0.0f, 0.0f);
4.
plane.setTextureCoordinate(1, q);
5.
q.set(1.0f, 0.0f);
6.
plane.setTextureCoordinate(2, q);
Texture image
Result
texture propertIes
The specification of the texture coordinates for the vertices of a 3D object corresponds
to defining the mapping of the loaded 2D texture image to various 2D surfaces of the 3D
object. This is one of the properties that can be changed in applying texture to an object.
The other properties concern how the texture will blend in with the other attributes, say,
the color, of the object.
In general, the application of texture can be specified through changing appropriate
settings in the Texture and TextureAttributes classes. Figure 4 shows the relationship of
these two classes to an appearance object.
Figure 4. Texture, TextureAttributes and Appearance classes
Search WWH ::




Custom Search