Class ForwardOrientedTexture

Direct Known Subclasses:
ForwardOrientedTextBlock, GlowingPoint

public class ForwardOrientedTexture extends AbstractCoordinateShape
Base class for textures always facing the viewer.

This class implements the "billboard" rendering technique where the texture remains oriented towards the camera regardless of 3D position. The visible size is calculated based on distance from viewer (z-coordinate) and scale factor.

The texture mapping algorithm: 1. Calculates screen coverage based on perspective 2. Clips to viewport boundaries 3. Maps texture pixels to screen pixels using proportional scaling

  • Field Details

    • texture

      public final Texture texture
  • Constructor Details

    • ForwardOrientedTexture

      public ForwardOrientedTexture(Point3D point, double scale, Texture texture)
  • Method Details

    • paint

      public void paint(RenderingContext targetRenderingArea)
      Paint the texture on the screen (targetRenderingArea)
      Specified by:
      paint in class AbstractCoordinateShape
      Parameters:
      targetRenderingArea - the screen to paint on
    • setScale

      public void setScale(double scale)
      Set the scale of the texture
      Parameters:
      scale - the scale of the texture
    • getLocation

      public Point3D getLocation()