Class Clip


  • public class Clip
    extends Object
    Clip a (projected) geometric Primitive that sticks out of the camera's view rectangle in the image plane. Interpolate Vertex color from any clipped off Vertex to the new Vertex.
    • Field Detail

      • debug

        public static boolean debug
    • Method Detail

      • clip

        public static Model clip​(Model model)
        Start with a Model that contains Primitives that have been projected onto the camera's view plane, z = -1.

        If a projected Primitive sticks out of the camera's view rectangle, then replace that Primitive, in the Model's list of primitives, with one that has been clipped so that it is contained in the view rectangle.

        If a projected Primitive is completely outside of the view rectangle, then drop that Primitive from the Model's list of primitives.

        Return a Model for which every Primitive is completely contained in the camera's view rectangle.

        Parameters:
        model - Model containing projected Primitives
        Returns:
        a Model containing Primitives clipped to the view rectangle