|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.rendering.r3d.ViewFrustum
public class ViewFrustum
Models a frustum volume, commonly used for view frustums (space volume visible to a viewer of a 3D scene).
Offers convenient methods for view-frustum culling (intersects(double[][])
, intersects(float[][])
),
viewer-relative movements (moveForward(double)
, moveRight(double)
, moveUp(double)
) as well as
rotations (rotateX(double)
, rotateY(double)
, rotateZ(double)
).
NOTE: The viewer-local coordinate system is modelled as a right-handed one, which must be taken into account when using the rotation methods: the Z-axis is oriented towards the opposite viewing direction.
Field Summary | |
---|---|
javax.vecmath.Point3d |
fbl
far bottom left |
javax.vecmath.Point3d |
fbr
far bottom right |
javax.vecmath.Point3d |
ftl
far top left |
javax.vecmath.Point3d |
ftr
far top right |
javax.vecmath.Point3d |
nbl
near bottom left |
javax.vecmath.Point3d |
nbr
near bottom right |
javax.vecmath.Point3d |
ntl
near top left |
javax.vecmath.Point3d |
ntr
near top right |
Constructor Summary | |
---|---|
ViewFrustum(double pitch,
double yaw,
double roll,
double distance,
javax.vecmath.Point3d lookingAt,
double fovy,
double aspect,
double zNear,
double zFar)
Create a view Frustum by using the given roll, pitch, yaw and distance to the point of interest (looking at), to calculate the eye and the up vector. |
|
ViewFrustum(javax.vecmath.Point3d eye,
javax.vecmath.Point3d lookingAt,
javax.vecmath.Vector3d up,
double fovy,
double aspect,
double zNear,
double zFar)
Create a viewFrustum from the given parameters. |
Method Summary | |
---|---|
javax.vecmath.Vector3d |
getBackward()
|
javax.vecmath.Point3d |
getEyePos()
|
double |
getFOVY()
|
javax.vecmath.Point3d |
getLookingAt()
|
javax.vecmath.Vector3d |
getRight()
|
javax.vecmath.Vector3d |
getUp()
|
double |
getZFar()
|
double |
getZNear()
|
boolean |
intersects(double[][] box)
|
boolean |
intersects(float[] box)
|
boolean |
intersects(float[][] box)
|
void |
moveForward(double delta)
Move the viewfrustum to the forward (according to the view direction). |
void |
moveRight(double delta)
Move the viewfrustum to the right (according to the view direction). |
void |
moveUp(double delta)
Move the viewfrustum to the up (according to the view direction). |
void |
rotateX(double delta)
Rotate the viewfrustum around the x-axis (according to the view direction). pitch |
void |
rotateY(double delta)
Rotate the viewfrustum around the y-axis (according to the view direction). roll |
void |
rotateZ(double delta)
Rotate the viewfrustum around the z-axis (according to the view direction). yaw |
void |
setCameraParams(javax.vecmath.Point3d eye,
javax.vecmath.Point3d lookingAt,
javax.vecmath.Vector3d up)
Sets the view frustum parameters that correspond to the viewing transform. |
void |
setPerspectiveParams(double fovy,
double aspect,
double zNear,
double zFar)
Sets the view frustum parameters that correspond to the perspective transformation matrix. |
String |
toInitString()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public javax.vecmath.Point3d ntl
public javax.vecmath.Point3d ntr
public javax.vecmath.Point3d nbl
public javax.vecmath.Point3d nbr
public javax.vecmath.Point3d ftl
public javax.vecmath.Point3d ftr
public javax.vecmath.Point3d fbl
public javax.vecmath.Point3d fbr
Constructor Detail |
---|
public ViewFrustum(javax.vecmath.Point3d eye, javax.vecmath.Point3d lookingAt, javax.vecmath.Vector3d up, double fovy, double aspect, double zNear, double zFar)
eye
- lookingAt
- up
- fovy
- the field-of-view in y directionaspect
- zNear
- zFar
- public ViewFrustum(double pitch, double yaw, double roll, double distance, javax.vecmath.Point3d lookingAt, double fovy, double aspect, double zNear, double zFar)
pitch
- yaw
- roll
- distance
- lookingAt
- fovy
- the field-of-view in y directionaspect
- zNear
- zFar
- Method Detail |
---|
public javax.vecmath.Point3d getEyePos()
public javax.vecmath.Point3d getLookingAt()
public javax.vecmath.Vector3d getUp()
public javax.vecmath.Vector3d getRight()
public javax.vecmath.Vector3d getBackward()
public double getFOVY()
public double getZNear()
public double getZFar()
public boolean intersects(double[][] box)
box
-
public boolean intersects(float[][] box)
box
-
public boolean intersects(float[] box)
box
-
public void setPerspectiveParams(double fovy, double aspect, double zNear, double zFar)
The parameters correspond to those of the OpenGL gluPerspective()
function.
NOTE: When this method is called, it is necessary to call setCameraParams(Point3d, Point3d, Vector3d)
afterwards, so the internal state is consistent.
fovy
- aspect
- zNear
- zFar
- public void setCameraParams(javax.vecmath.Point3d eye, javax.vecmath.Point3d lookingAt, javax.vecmath.Vector3d up)
The parameters correspond to those of the OpenGL gluLookAt()
function.
eye
- lookingAt
- up
- public void moveRight(double delta)
delta
- public void moveUp(double delta)
delta
- public void moveForward(double delta)
delta
- public void rotateX(double delta)
delta
- public void rotateY(double delta)
delta
- public void rotateZ(double delta)
delta
- public String toString()
toString
in class Object
public String toInitString()
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |