Interface Drawable3D

All Known Implementing Classes:
Chart3D, DefaultDrawable3D

public interface Drawable3D
A three dimensional scene that can be viewed from an arbitrary viewpoint and rendered to any Graphics2D instance. The Chart3D class implements this interface.
See Also:
  • Method Details

    • getDimensions

      Returns the aggregate dimensions of the objects in the 3D scene. This will be a bounding box for all the objects. One use for this information is to determine a suitable default viewing distance for a given scene (one that sizes the 2D projection to something appropriate for the available drawing space).
      Returns:
      The dimensions (never null).
    • getViewPoint

      Returns the point from which the 3D scene is viewed. The viewing point determines how the 3D scene is projected onto the 2D viewing plane in the draw(java.awt.Graphics2D, java.awt.geom.Rectangle2D) method.
      Returns:
      The view point (never null).
    • setViewPoint

      void setViewPoint(ViewPoint3D viewPoint)
      Sets a new view point. Note that the ViewPoint3D class is implemented so that its position and orientation can be updated directly, so you should use this method only when you want to set an entirely new view point.
      Parameters:
      viewPoint - the view point (null not permitted).
    • getProjDistance

      double getProjDistance()
      Returns the projection distance. A typical value is 1500, higher numbers flatten out the perspective and reduce distortion in the projected image.
      Returns:
      The projection distance.
      Since:
      1.2
    • setProjDistance

      void setProjDistance(double dist)
      Sets the projection distance. A typical value is 1500 (but this will depend on the dimensions of the scene), higher numbers flatten out the perspective and reduce distortion in the projected image.
      Parameters:
      dist - the distance.
      Since:
      1.2
    • getTranslate2D

      Returns the 2D offset for the scene. Normally this will default to (0, 0).
      Returns:
      The translation offset (never null).
    • setTranslate2D

      void setTranslate2D(Offset2D offset)
      Sets the translation offset. This is typically used to allow the user to modify the offset of a 2D projection on-screen by dragging with the mouse.
      Parameters:
      offset - the translation offset (null not permitted).
    • draw

      Draws the scene to the supplied Graphics2D target and returns an object containing state information about the rendering.
      Parameters:
      g2 - the graphics target (null not permitted).
      bounds - the bounds (null not permitted).
      Returns:
      State information about the 3D scene that has been drawn (never null).