public class TexturedPolygon extends AbstractCoordinateShape
Textured polygon.

 This is how perspective-correct texture rendering is implemented:
 If polygon is sufficiently small, it is rendered without perspective correction.
 Otherwise, it is sliced into smaller polygons.
 
  • Field Details

    • texture

      public final Texture texture
    • showBorders

      public boolean showBorders
      If true then polygon borders will be drawn. It is used for debugging purposes.
  • Constructor Details

  • Method Details

    • paint

      public void paint(RenderingContext renderBuffer)
      Description copied from class: AbstractCoordinateShape
      Paints this shape onto the rendering context's pixel buffer.

      This method is called after all shapes have been transformed and sorted by depth. Implementations should use the transformed screen-space coordinates from Vertex.transformedCoordinate to draw pixels.

      Specified by:
      paint in class AbstractCoordinateShape
      Parameters:
      renderBuffer - the rendering context containing the pixel buffer and graphics context
    • isBackfaceCullingEnabled

      public boolean isBackfaceCullingEnabled()
    • setBackfaceCulling

      public void setBackfaceCulling(boolean backfaceCulling)