org.rajawali3d.materials / Material

Material

open class Material
open class Material

The Material class is where you define the visual characteristics of your 3D model. Here you can specify lighting parameters, specular highlights, ambient colors and much more. This is the place where you add textures as well. For an overview of the different types of materials and parameters visit the Rajawali Wiki.

This is a basic example using lighting, a texture, Lambertian diffuse model and Phong specular highlights:

  Material material = new Material();
  material.addTexture(new Texture("earth", R.drawable.earth_diffuse));
  material.enableLighting(true);
  material.setDiffuseMethod(new DiffuseMethod.Lambert());
  material.setSpecularMethod(new SpecularMethod.Phong());
  
  myObject.setMaterial(material);
  

Author
dennis.ippel

See Also
<a href="https://github.com/MasDennis/Rajawali/wiki/Materials">https://github.com/MasDennis/Rajawali/wiki/Materials</a>