org.deegree.rendering.r3d
Class ViewParams

java.lang.Object
  extended by org.deegree.rendering.r3d.ViewParams

public class ViewParams
extends Object

Encapsulates the relevant viewing and projection parameters that are needed for performing view frustum culling and LOD (level-of-detail) adaptation.

Version:
$Revision: 30126 $, $Date: 2011-03-22 11:11:00 +0100 (Tue, 22 Mar 2011) $
Author:
Markus Schneider, last edited by: $Author: aschmitz $

Constructor Summary
ViewParams(javax.vecmath.Point3d eye, javax.vecmath.Point3d lookingAt, javax.vecmath.Vector3d viewerUp, double fovy, double zNear, double zFar)
           
ViewParams(ViewFrustum vf, int projectionWidth, int projectionHeight)
          Creates a new ViewParams instance from the given parameters.
 
Method Summary
 double estimatePixelSizeForSpaceUnit(double dist)
          Returns a guaranteed upper bound for the size that a world-space unit (e.g. a line with length 1) has in pixels after perspective projection, i.e. in pixels on the screen.
 int getScreenPixelsX()
          Returns the number of pixels of the projected image in x direction.
 int getScreenPixelsY()
          Returns the number of pixels of the projected image in y direction.
 ViewFrustum getViewFrustum()
          Returns the view frustum (volume visible to the viewer).
 void setProjectionPlaneDimensions(int width, int height)
          Set the new projection plane dimensions
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ViewParams

public ViewParams(javax.vecmath.Point3d eye,
                  javax.vecmath.Point3d lookingAt,
                  javax.vecmath.Vector3d viewerUp,
                  double fovy,
                  double zNear,
                  double zFar)
Parameters:
eye -
lookingAt -
viewerUp -
fovy -
zNear -
zFar -

ViewParams

public ViewParams(ViewFrustum vf,
                  int projectionWidth,
                  int projectionHeight)
Creates a new ViewParams instance from the given parameters.

Parameters:
vf - view frustum (volume visible to the viewer)
projectionWidth - number of pixels of the projected image in the x direction
projectionHeight - number of pixels of the projected image in the y direction
Method Detail

getViewFrustum

public ViewFrustum getViewFrustum()
Returns the view frustum (volume visible to the viewer).

Returns:
view frustum

getScreenPixelsX

public int getScreenPixelsX()
Returns the number of pixels of the projected image in x direction.

Returns:
number of pixels in x direction

getScreenPixelsY

public int getScreenPixelsY()
Returns the number of pixels of the projected image in y direction.

Returns:
number of pixels in y direction

estimatePixelSizeForSpaceUnit

public double estimatePixelSizeForSpaceUnit(double dist)
Returns a guaranteed upper bound for the size that a world-space unit (e.g. a line with length 1) has in pixels after perspective projection, i.e. in pixels on the screen.

Parameters:
dist - distance of the object (from the point-of-view)
Returns:
maximum number of pixels that an object of size 1 will cover

setProjectionPlaneDimensions

public void setProjectionPlaneDimensions(int width,
                                         int height)
Set the new projection plane dimensions

Parameters:
width -
height -

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.