Class OrthographicCamera.Builder

java.lang.Object
com.luciad.cameras.OrthographicCamera.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
OrthographicCamera

public static final class OrthographicCamera.Builder extends Object implements AutoCloseable
Factory object that can create new OrthographicCamera instances.
  • Constructor Details

  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • look2D

      @NotNull public OrthographicCamera.Builder look2D(@NotNull Camera.Look2D look)
      Sets up a 2D camera viewpoint, looking straight down (along the z axis to plane at z=0).
      Parameters:
      look - the description of target, scaling and orientation description for the new camera.
      Returns:
      this builder
    • nearFar

      @NotNull public OrthographicCamera.Builder nearFar(double nearPlane, double farPlane)
      Sets the near and far clipping distances of the new camera.

      These values only take effect when the map's automatic near/far adjustment is turned off (see Map#setAutoAdjustDepthRangeEnabled). With that adjustment on (the default), the map manages the near and far for you, so values set here apply only once you turn it off. A freshly built orthographic camera defaults to a near of -9000 and a far of 20000.

      The near and far bound the depth range: the interval along the view direction, measured from the eye, that is kept. For an orthographic projection the view volume between them is a box (parallel, equally sized near and far planes), so unlike a perspective camera the near distance may be zero or negative, depth is linear, and the far to near ratio does not affect precision. The range only has to contain the geometry you want to keep visible, so bracketing your content with some margin is enough (for a top-down view, a range that is roughly symmetric around the plane you are looking at works well).

      Practical note: the orthographic camera is currently only used for 2D (projected, grid) maps, where all content lies in the map plane (at z=0), so the exact near and far have little visible effect as long as the range contains that plane.

      Parameters:
      nearPlane - the distance from the eye to the near clipping plane.
      farPlane - the distance from the eye to the far clipping plane.
      Returns:
      this builder
      Since:
      2026.1
    • build

      @NotNull public OrthographicCamera build()
      Returns a new orthographic camera.
      Returns:
      a new orthographic camera.