Skip to content
Dennis Ippel edited this page Aug 19, 2013 · 15 revisions

(Anchor Steam) Materials

(Just dumping information here at the moment, this will be more coherent)

Creating an unlit color material

java Material material = new Material(); material.setColor(Color.RED); // color influence is only used when textures are used // in this case it specifies that 20% of the color should // be used in the final color material.setColorInfluence(.2f); material.enableLighting(true); material.setLights(lights); material.setDiffuseMethod(new DiffuseMethod.Lambert()); material.setSpecularMethod(new SpecularMethod.Phong());

Texture tex1 = new Texture("earth", R.drawable.earth_diffuse); // this texture's color influence (40%) tex1.setInfluence(.4f); Texture tex2 = new Texture("camden", R.drawable.camden_town_alpha); // this texture's color influence (40%) tex2.setInfluence(.4f);

// you can add as many diffuse textures as you'd like material.addTexture(tex1); material.addTexture(tex2);

sphere.setMaterial(material);

Clone this wiki locally