Package renderer.scene.util
Class ModelShading
- java.lang.Object
-
- renderer.scene.util.ModelShading
-
public class ModelShading extends Object
This is a library of static methods that add color shading to aModel
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Color
randomColor()
static void
setColor(Model model, Color c)
static void
setRainbowPrimitiveColors(Model model)
static void
setRandomColor(Model model)
static void
setRandomColors(Model model)
static void
setRandomPrimitiveColors(Model model)
static void
setRandomVertexColors(Model model)
-
-
-
Method Detail
-
setRandomColor
public static void setRandomColor(Model model)
- Parameters:
model
-Model
whose color list is being manipulated
-
setRandomColors
public static void setRandomColors(Model model)
- Parameters:
model
-Model
whose color list is being manipulated
-
setRandomVertexColors
public static void setRandomVertexColors(Model model)
Set eachVertex
in theModel
to a different randomColor
.This creates a "rainbow model" effect.
NOTE: This will destroy whatever "color structure" the model might possess.
- Parameters:
model
-Model
whose color list is being manipulated
-
setRandomPrimitiveColors
public static void setRandomPrimitiveColors(Model model)
Set eachPrimitive
in theModel
to a different (uniform) randomColor
.NOTE: This will destroy whatever "color structure" the model might possess.
- Parameters:
model
-Model
whose color list is being manipulated
-
setRainbowPrimitiveColors
public static void setRainbowPrimitiveColors(Model model)
Set eachPrimitive
in theModel
to a different randomColor
at each endpoint.This creates a "rainbow primitive" effect.
NOTE: This will destroy whatever "color structure" the model might possess.
- Parameters:
model
-Model
whose color list is being manipulated
-
randomColor
public static Color randomColor()
- Returns:
- a reference to a randomly generated
Color
object
-
-