de.grogra.imp3d
Class CanvasCamera
java.lang.Object
de.grogra.imp3d.CameraBase
de.grogra.imp3d.CanvasCamera
public class CanvasCamera
- extends CameraBase
Method Summary |
void |
getRay(float x,
float y,
Point3d origin,
Vector3d direction)
Determines the ray which starts at the camera and goes through
the specified point on the image plane of the camera. |
float |
getScaleAt(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. |
float |
getScaleAt(float z)
Computes an estimate for the scaling factor from view coordinates
around a depth of z to 2D coordinates
on the camera plane. |
Matrix4d |
getWorldToViewTransformation()
Returns the world-to-view transformation of this camera. |
float |
getZFar()
|
float |
getZNear()
|
int |
projectView(float x,
float y,
float z,
Tuple2f point2D,
boolean checkClip)
|
int |
projectWorld(Tuple3d point,
Tuple2f point2D)
|
void |
setDimension(int width,
int height)
|
void |
setWorldToViewTransformation(Matrix4d t,
Transaction ts)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSIDE_CLIPPING
public static final int INSIDE_CLIPPING
- See Also:
- Constant Field Values
OUTSIDE_XY_CLIPPING
public static final int OUTSIDE_XY_CLIPPING
- See Also:
- Constant Field Values
OUTSIDE_Z_CLIPPING
public static final int OUTSIDE_Z_CLIPPING
- See Also:
- Constant Field Values
CanvasCamera
public CanvasCamera()
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 planey
- the y-coordinate on the image planeorigin
- the origin of the ray, in world coordinatesdirection
- the direction of the ray, in world coordinates
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 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:
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
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
getZFar
public float getZFar()
- Specified by:
getZFar
in class CameraBase
getZNear
public float getZNear()
- Specified by:
getZNear
in class CameraBase
projectView
public int projectView(float x,
float y,
float z,
Tuple2f point2D,
boolean checkClip)
projectWorld
public int projectWorld(Tuple3d point,
Tuple2f point2D)
setDimension
public void setDimension(int width,
int height)
setWorldToViewTransformation
public void setWorldToViewTransformation(Matrix4d t,
Transaction ts)