- Forward


Texture Mapping in Java3D
An Introduction with Examples


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu

Print

Steps in the Process
Back SMYC Forward
  • Prepare texture images
  • Load the texture
  • Add the texture to an Appearance
  • Specify a mapping from the texture to pixels
Loading a Texture
Back SMYC Forward
  • The TextureLoader Class:
    • Loads textures from image files
  • The ImageComponent2D Class:
    • Encapsulates the image
  • The Texture Class:
    • Encapsulates the texture
Loading a Texture and Creating an Appearance
Back SMYC Forward

An Example

javaexamples/java3d/textures/TexturedCubeFactory.java (Fragment: createTexture)
 
Texture Coordinates
Back SMYC Forward
  • Two Dimensional:
    • TexCoord2f
  • Three Dimensional
    • TexCoord3f
Texture Coordinates (cont.)
Back SMYC Forward

The Data

javaexamples/java3d/textures/TexturedCubeFactory.java (Fragment: data)
 
Texture Coordinates (cont.)
Back SMYC Forward

The Mapping

javaexamples/java3d/textures/TexturedCubeFactory.java (Fragment: createCube)
 
There's Always More to Learn
Back -