de.grogra.imp3d
public class CanvasCamera extends CameraBase
| Modifier and Type | Field and Description |
|---|---|
static int |
INSIDE_CLIPPING |
static int |
OUTSIDE_XY_CLIPPING |
static int |
OUTSIDE_Z_CLIPPING |
| Constructor and Description |
|---|
CanvasCamera() |
| Modifier and Type | Method and Description |
|---|---|
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) |
public static final int INSIDE_CLIPPING
public static final int OUTSIDE_XY_CLIPPING
public static final int OUTSIDE_Z_CLIPPING
public void getRay(float x,
float y,
Point3d origin,
Vector3d direction)
CameraBasegetRay in class CameraBasex - 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 coordinatespublic float getScaleAt(double x,
double y,
double z)
CameraBase(x, y, z) to 2D coordinates
on the camera plane.getScaleAt in class CameraBasex - x world coordinatey - y world coordinatez - z world coordinatepublic float getScaleAt(float z)
CameraBasez to 2D coordinates
on the camera plane.getScaleAt in class CameraBasez - z view coordinatepublic Matrix4d getWorldToViewTransformation()
CameraBasegetWorldToViewTransformation in class CameraBasepublic float getZFar()
getZFar in class CameraBasepublic float getZNear()
getZNear in class CameraBasepublic int projectView(float x,
float y,
float z,
Tuple2f point2D,
boolean checkClip)
public void setDimension(int width,
int height)
public void setWorldToViewTransformation(Matrix4d t, Transaction ts)