Class ModelShading

    • Method Detail

      • setRandomColor

        public static void setRandomColor​(Model model)
        Set each Color in the Model's color list to the same random Color.
        Parameters:
        model - Model whose color list is being manipulated
      • setRandomColors

        public static void setRandomColors​(Model model)
        Set each Color in the Model's color list to a different random Color.
        Parameters:
        model - Model whose color list is being manipulated
      • setRandomVertexColors

        public static void setRandomVertexColors​(Model model)
        Set each Vertex in the Model to a different random Color.

        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 each Primitive in the Model to a different (uniform) random Color.

        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 each Primitive in the Model to a different random Color 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()
        Create a Color object with randomly generated r, g, and b values.
        Returns:
        a reference to a randomly generated Color object