java.lang.Object
de.grogra.imp3d.CameraBase
de.grogra.imp3d.CanvasCamera
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDetermines the ray which starts at the camera and goes through the specified point on the image plane of the camera.floatgetScaleAt(double x, double y, double z) Computes an estimate for the scaling factor from 3D world coordinates at(x, y, z)to 2D coordinates on the camera plane.floatgetScaleAt(float z) Computes an estimate for the scaling factor from view coordinates around a depth ofzto 2D coordinates on the camera plane.Returns the world-to-view transformation of this camera.floatgetZFar()floatgetZNear()intprojectView(float x, float y, float z, Tuple2f point2D, boolean checkClip) intprojectWorld(Tuple3d point, Tuple2f point2D) voidsetDimension(int width, int height) void
-
Field Details
-
OUTSIDE_Z_CLIPPING
public static final int OUTSIDE_Z_CLIPPING- See Also:
-
OUTSIDE_XY_CLIPPING
public static final int OUTSIDE_XY_CLIPPING- See Also:
-
INSIDE_CLIPPING
public static final int INSIDE_CLIPPING- See Also:
-
-
Constructor Details
-
CanvasCamera
public CanvasCamera()
-
-
Method Details
-
setDimension
public void setDimension(int width, int height) -
projectWorld
-
projectView
-
getZNear
public float getZNear()- Specified by:
getZNearin classCameraBase
-
getZFar
public float getZFar()- Specified by:
getZFarin classCameraBase
-
getScaleAt
public float getScaleAt(double x, double y, double z) Description copied from class:CameraBaseComputes an estimate for the scaling factor from 3D world coordinates at(x, y, z)to 2D coordinates on the camera plane.- Specified by:
getScaleAtin classCameraBase- Parameters:
x- x world coordinatey- y world coordinatez- z world coordinate- Returns:
- scaling factor of camera projection at location
-
getScaleAt
public float getScaleAt(float z) Description copied from class:CameraBaseComputes an estimate for the scaling factor from view coordinates around a depth ofzto 2D coordinates on the camera plane.- Specified by:
getScaleAtin classCameraBase- Parameters:
z- z view coordinate- Returns:
- scaling factor of camera projection at location
-
getRay
Description copied from class:CameraBaseDetermines the ray which starts at the camera and goes through the specified point on the image plane of the camera.- Specified by:
getRayin classCameraBase- Parameters:
x- the x-coordinate on the image planey- the y-coordinate on the image planeorigin- the origin of the ray, in world coordinatesdirection- the direction of the ray, in world coordinates
-
getWorldToViewTransformation
Description copied from class:CameraBaseReturns the world-to-view transformation of this camera. It transforms world coordinates to view coordinates (= camera coordinates).- Specified by:
getWorldToViewTransformationin classCameraBase- Returns:
- world-to-view transformation
-
setWorldToViewTransformation
-