|
|
@@ -53,24 +53,28 @@ In the <<jme3/advanced/materials_overview#,Materials Overview>> list:
|
|
|
In your Java code,
|
|
|
|
|
|
. Create a Material object based on the chosen Material Definition (.j3md file):
|
|
|
++
|
|
|
[source,java]
|
|
|
----
|
|
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
|
|
|
----
|
|
|
|
|
|
. Configure your Material by setting the appropriate values listed in the <<jme3/advanced/materials_overview#,Materials Overview>> table.
|
|
|
++
|
|
|
[source,java]
|
|
|
----
|
|
|
mat.setColor("Color", ColorRGBA.Yellow ); // and more
|
|
|
----
|
|
|
|
|
|
. Apply your prepared Material to a Geometry:
|
|
|
++
|
|
|
[source,java]
|
|
|
----
|
|
|
myGeometry.setMaterial(mat);
|
|
|
----
|
|
|
|
|
|
. (Optional) Adjust the texture scale of the mesh:
|
|
|
++
|
|
|
[source,java]
|
|
|
----
|
|
|
myGeometryMesh.scaleTextureCoordinates(new Vector2f(2f, 2f));
|