Module imp3d

Class CanvasCamera

java.lang.Object
de.grogra.imp3d.CameraBase
de.grogra.imp3d.CanvasCamera

public class CanvasCamera extends CameraBase
  • Field Details

  • Constructor Details

    • CanvasCamera

      public CanvasCamera()
  • Method Details

    • setDimension

      public void setDimension(int width, int height)
    • projectWorld

      public int projectWorld(Tuple3d point, Tuple2f point2D)
    • projectView

      public int projectView(float x, float y, float z, Tuple2f point2D, boolean checkClip)
    • getZNear

      public float getZNear()
      Specified by:
      getZNear in class CameraBase
    • getZFar

      public float getZFar()
      Specified by:
      getZFar in class CameraBase
    • getScaleAt

      public float getScaleAt(double x, double y, double z)
      Description copied from class: CameraBase
      Computes an estimate for the scaling factor from 3D world coordinates at (x, y, z) to 2D coordinates on the camera plane.
      Specified by:
      getScaleAt in class CameraBase
      Parameters:
      x - x world coordinate
      y - y world coordinate
      z - z world coordinate
      Returns:
      scaling factor of camera projection at location
    • getScaleAt

      public float getScaleAt(float z)
      Description copied from class: CameraBase
      Computes an estimate for the scaling factor from view coordinates around a depth of z to 2D coordinates on the camera plane.
      Specified by:
      getScaleAt in class CameraBase
      Parameters:
      z - z view coordinate
      Returns:
      scaling factor of camera projection at location
    • getRay

      public void getRay(float x, float y, Point3d origin, Vector3d direction)
      Description copied from class: CameraBase
      Determines the ray which starts at the camera and goes through the specified point on the image plane of the camera.
      Specified by:
      getRay in class CameraBase
      Parameters:
      x - the x-coordinate on the image plane
      y - the y-coordinate on the image plane
      origin - the origin of the ray, in world coordinates
      direction - the direction of the ray, in world coordinates
    • getWorldToViewTransformation

      public Matrix4d getWorldToViewTransformation()
      Description copied from class: CameraBase
      Returns the world-to-view transformation of this camera. It transforms world coordinates to view coordinates (= camera coordinates).
      Specified by:
      getWorldToViewTransformation in class CameraBase
      Returns:
      world-to-view transformation
    • setWorldToViewTransformation

      public void setWorldToViewTransformation(Matrix4d t, Transaction ts)