textures - thothbot/parallax GitHub Wiki
Using textures, you can create a table with a wood grain, an orange with a dimpled, shiny surface, and a field of grass. To do so, first create wood, orange peel, and grass textures and then apply the textures to the various shape objects.
Class diagram for textures
Basic texture class, which supports the following textures:
- 2D textures
- Canvas 2D textures
- Video textures
Usage is very simple:
private static final String image = "./static/textures/ash_uvgrid01.jpg";
Texture texture = new Texture(image);
If you wish to handle image load event you should implement ImageLoadHandler
:
Texture texture = new Texture(image, new ImageLoadHandler() {
@Override
void onImageLoad(Texture texture) {
/* code */
}
});
Also this class has some useful methods:
// Method of enhancing the image quality of texture on surfaces
// that are at oblique viewing angles
texture.setAnisotropy(5);
Cube textures are a set of six two-dimensional texture images mapped onto the six faces of a cube centered at the origin. Cube maps are well suited for mapping a reflection of the environment onto an object.
To use this class you should create new folder where need to put six texture files which are named as the following or similar:
nx.jpg, ny.jpg, nz.jpg, px.jpg, py.jpg, pz.jpg
Then call class constructor:
private static final String textures = "./static/textures/cube/pisa/*.png";
CubeTexture textureCube = new CubeTexture( textures );
Data texture is Uint8Array
where you can set a color of each pixel.
Supports DDS-textures.
The same as CubeTexture, but uses dds-textures