All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.View

java.lang.Object
   |
   +----java.media.j3d.View

public class View
extends Object
The View object contains all parameters needed in rendering a three dimensional scene from one viewpoint. A view contains a list of Canvas3D objects that the view is rendered into. It exists outside of the scene graph, but attaches to a ViewPlatform leaf node object in the scene graph.


Variable Index

 o HMD_VIEW
Specifies that Java 3D should compute new viewpoints using that sequence of transforms appropriate to head-mounted display environments.
 o NOMINAL_FEET
Specifies that Java 3D should locate the user's virtual head at whatever vertical position is needed to ensure that the user's virtual feet touch the virtual ground plane (as determined by the current head position).
 o NOMINAL_HEAD
Specifies that Java 3D should locate the user's virtual head at the same point as the user's physical head (as determined by the current head position).
 o NOMINAL_SCREEN
Specifies that Java 3D should locate the user's virtual head at a point offset by nominalEyeDistanceFromNominalScreen from the user's physical head (as determined by the current head position).
 o PARALLEL_PROJECTION
Specifies that Java 3D should generate a parallel projection matrix for this View.
 o PERSPECTIVE_PROJECTION
Specifies that Java 3D should generate a perspective projection matrix for this View.
 o PHYSICAL_EYE
Specifies that the associated distance is measured from the eye and in the physical environment.
 o PHYSICAL_SCREEN
Specifies that the associated distance is measured from the screen and in the physical environment.
 o SCREEN_VIEW
Specifies that Java 3D should compute new viewpoints using that sequence of transforms appropriate to screen-based head-tracked display environments (fish-tank VR/portals/VR-desks).
 o VIRTUAL_EYE
Specifies that the associated distance is measured from the eye and in the virtual environment.
 o VIRTUAL_SCREEN
Specifies that the associated distance is measured from the screen and in the virtual environment.

Constructor Index

 o View()
Constructs and initializes a View object.

Method Index

 o addCanvas3D(Canvas3D)
Adds the given canvas3D at the end of the list.
 o attachViewPlatform(ViewPlatform)
Attach viewPlatform structure to this view.
 o getAllCanvas3Ds()
Gets the enumeration object of all the canvas3Ds.
 o getBackClipDistance()
Returns the view model's back clip distance.
 o getBackClipPolicy()
Returns the view model's current back clip policy.
 o getCanvas3D(int)
Gets the canvas3D from the given index position.
 o getCompatibilityModeEnable()
Retrieves the compatibility mode enable flag.
 o getCurrentFrameStartTime()
This method returns the time at which the most recent rendering frame started.
 o getDepthBufferFreezeTransparent()
Retrieves the current value of the depth buffer freeze transparent flag for this view.
 o getFieldOfView()
Returns the current field of view.
 o getFrontClipDistance()
Returns the view model's front clip distance.
 o getFrontClipPolicy()
Returns the view model's current front clip policy.
 o getLastFrameDuration()
This method returns the duration, in milliseconds, of the most recently completed rendering frame.
 o getLeftProjection(Transform3D)
Retrieves the current projection transform for the left eye and places it into the specified object.
 o getLocalEyeLightingEnable()
Retrieves a flag that indicates whether or not local eye lighting is enabled for this view.
 o getPhysicalBody()
Returns a reference to the view model's PhysicalBody object.
 o getPhysicalEnvironment()
Returns a reference to the view model's PhysicalEnvironment object.
 o getProjectionPolicy()
Retrieves the current projection policy for this View.
 o getRightProjection(Transform3D)
Retrieves the current projection transform for the right eye and places it into the specified object.
 o getSceneAntialiasingEnable()
Returns a flag that indicates whether or not scene antialiasing is enabled for this view.
 o getSensorHotspotInVworld(Sensor, Point3d)
Retrieves the position of the specified Sensor's last known hotspot position in virtual-world coordinates and copies that value into the vector provided.
 o getSensorHotspotInVworld(Sensor, Point3f)
Retrieves the position of the specified Sensor's last known hotspot position in virtual-world coordinates and copies that value into the vector provided.
 o getSensorToVworld(Sensor, Transform3D)
Computes the sensor to virtual-world transform and copies that value into the transform provided.
 o getTrackingEnable()
Returns a status flag indicating whether or not tracking is enabled.
 o getUserHeadToTrackerBase(Transform3D)
Retrieves the user-head to the head-tracker-base transform and copies that value into the specified Transform3D object.
 o getUserHeadToVworld(Transform3D)
Retrieves the user-head to virtual-world transform and copies that value into the transform provided.
 o getUserHeadToVworldEnable()
Returns a status flag indicating whether or not Java 3D is continuously updating the userHeadToVworldEnable transform.
 o getViewPolicy()
Retrieves the current view computation policy for this View.
 o getVpcToEc(Transform3D)
Retrieves the current ViewPlatform Coordinates (VPC) system to Eye Coordinates (EC) transform and copies it into the specified object.
 o insertCanvas3D(Canvas3D, int)
Inserts the canvas3D at the given index position.
 o removeCanvas3D(Canvas3D)
Removes the given canvas3D.
 o removeCanvas3D(int)
Removes the canvas3D from the given index position.
 o setBackClipDistance(double)
Sets the view model's back clip distance.
 o setBackClipPolicy(int)
Sets the view model's back clip policy, the policy Java 3D uses in computing where to place the back clip plane.
 o setCanvas3D(Canvas3D, int)
Sets given canvas3D at the given index position.
 o setCompatibilityModeEnable(boolean)
Sets the compatibility mode enable flag to true or false.
 o setDepthBufferFreezeTransparent(boolean)
Enables or disables automatic freezing of the depth buffer for objects rendered during the transparent rendering pass (i.e., objects rendered using alpha blending) for this view.
 o setFieldOfView(double)
Sets the field of view used to compute the projection transform.
 o setFrontClipDistance(double)
Sets the view model's front clip distance.
 o setFrontClipPolicy(int)
Sets the view model's front clip policy, the policy Java 3D uses in computing where to place the front clip plane.
 o setLeftProjection(Transform3D)
Compatibility mode function that specifies a viewing frustum for the left eye that transforms points in Eye Coordinates (EC) to Clipping Coordinates (CC).
 o setLocalEyeLightingEnable(boolean)
Sets a flag that indicates whether the local eye point is used in lighting calculations for perspective projections.
 o setPhysicalBody(PhysicalBody)
Sets the view model's physical body to the PhysicalBody object provided.
 o setPhysicalEnvironment(PhysicalEnvironment)
Sets the view model's physical environment to the PhysicalEnvironment object provided.
 o setProjectionPolicy(int)
Sets the projection policy for this View.
 o setRightProjection(Transform3D)
Compatibility mode function that specifies a viewing frustum for the right eye that transforms points in Eye Coordinates (EC) to Clipping Coordinates (CC).
 o setSceneAntialiasingEnable(boolean)
Enables or disables scene antialiasing for this view.
 o setTrackingEnable(boolean)
Turns tracking on or off.
 o setUserHeadToVworldEnable(boolean)
Turns on or off the continuous updating of the userHeadToVworld transform.
 o setViewPolicy(int)
Sets the policy for view computation.
 o setVpcToEc(Transform3D)
Compatibility mode method that specifies the ViewPlatform Coordinates (VPC) to Eye Coordinates (EC) transform.

Variables

 o NOMINAL_HEAD
 public static final int NOMINAL_HEAD
Specifies that Java 3D should locate the user's virtual head at the same point as the user's physical head (as determined by the current head position). One of three policies (NOMINAL_HEAD, NOMINAL_SCREEN, and NOMINAL_FEET) for determining eye position as a function of current head position.

 o NOMINAL_SCREEN
 public static final int NOMINAL_SCREEN
Specifies that Java 3D should locate the user's virtual head at a point offset by nominalEyeDistanceFromNominalScreen from the user's physical head (as determined by the current head position). This offset, in effect, creates a viewpoint where the user sees an object from an optimal viewpoint. One of three policies (NOMINAL_HEAD, NOMINAL_SCREEN, and NOMINAL_FEET) for determining eye position as a function of current head position.

 o NOMINAL_FEET
 public static final int NOMINAL_FEET
Specifies that Java 3D should locate the user's virtual head at whatever vertical position is needed to ensure that the user's virtual feet touch the virtual ground plane (as determined by the current head position). One of three policies (NOMINAL_HEAD, NOMINAL_SCREEN, and NOMINAL_FEET) for determining eye position as a function of current head position.

 o PHYSICAL_EYE
 public static final int PHYSICAL_EYE
Specifies that the associated distance is measured from the eye and in the physical environment. Policy for interpreting clip plane distances. Used in specifying the policy in frontClipPolicy and backClipPolicy.

 o PHYSICAL_SCREEN
 public static final int PHYSICAL_SCREEN
Specifies that the associated distance is measured from the screen and in the physical environment. Policy for interpreting clip plane distances. Used in specifying the policy in frontClipPolicy and backClipPolicy.

 o VIRTUAL_EYE
 public static final int VIRTUAL_EYE
Specifies that the associated distance is measured from the eye and in the virtual environment. Policy for interpreting clip plane distances. Used in specifying the policy in frontClipPolicy and backClipPolicy.

 o VIRTUAL_SCREEN
 public static final int VIRTUAL_SCREEN
Specifies that the associated distance is measured from the screen and in the virtual environment. Policy for interpreting clip plane distances. Used in specifying the policy in frontClipPolicy and backClipPolicy.

 o SCREEN_VIEW
 public static final int SCREEN_VIEW
Specifies that Java 3D should compute new viewpoints using that sequence of transforms appropriate to screen-based head-tracked display environments (fish-tank VR/portals/VR-desks). One of two policies for view computation: SCREEN_VIEW and HMD_VIEW.

 o HMD_VIEW
 public static final int HMD_VIEW
Specifies that Java 3D should compute new viewpoints using that sequence of transforms appropriate to head-mounted display environments. One of two policies for view computation: SCREEN_VIEW and HMD_VIEW.

 o PARALLEL_PROJECTION
 public static final int PARALLEL_PROJECTION
Specifies that Java 3D should generate a parallel projection matrix for this View.

 o PERSPECTIVE_PROJECTION
 public static final int PERSPECTIVE_PROJECTION
Specifies that Java 3D should generate a perspective projection matrix for this View. This is the default mode.

Constructors

 o View
 public View()
Constructs and initializes a View object. Only some of the attributes are fully initialized.

Returns:
a new View

Methods

 o setViewPolicy
 public final void setViewPolicy(int policy)
Sets the policy for view computation. This variable specifies how Java 3D uses its transforms in computing new viewpoints.

Parameters:
policy - the new policy, one of SCREEN_VIEW or HMD_VIEW
 o getViewPolicy
 public final int getViewPolicy()
Retrieves the current view computation policy for this View.

Returns:
one of: SCREEN_VIEW or HMD_VIEW.
 o setProjectionPolicy
 public final void setProjectionPolicy(int policy)
Sets the projection policy for this View. This variable specifies the type of projection transform that will be generated. A value of PARALLEL_PROJECTION specifies that a parallel projection transform is generated. A value of PERSPECTIVE_PROJECTION specifies that a perspective projection transform is generated. The default projection policy is perspective.

Parameters:
policy - the new policy, one of PARALLEL_PROJECTION or PERSPECTIVE_PROJECTION
 o getProjectionPolicy
 public final int getProjectionPolicy()
Retrieves the current projection policy for this View.

Returns:
one of: PARALLEL_PROJECTION or PERSPECTIVE_PROJECTION.
 o setCompatibilityModeEnable
 public final void setCompatibilityModeEnable(boolean flag)
Sets the compatibility mode enable flag to true or false. Compatibility mode is disabled by default.

Parameters:
flag - the new compatibility mode enable flag
 o getCompatibilityModeEnable
 public final boolean getCompatibilityModeEnable()
Retrieves the compatibility mode enable flag.

Returns:
the current compatibility mode enable flag
 o setLeftProjection
 public final void setLeftProjection(Transform3D projection)
Compatibility mode function that specifies a viewing frustum for the left eye that transforms points in Eye Coordinates (EC) to Clipping Coordinates (CC). If compatibility mode is disabled, then the projection is derived from other values and is read-only. In monoscopic mode, only the left eye projection matrix is used.

Parameters:
projection - the new left eye projection transform
Throws: RestrictedAccessException
if compatibility mode is disabled.
 o setRightProjection
 public final void setRightProjection(Transform3D projection)
Compatibility mode function that specifies a viewing frustum for the right eye that transforms points in Eye Coordinates (EC) to Clipping Coordinates (CC). If compatibility mode is disabled, then the projection is derived from other values and is read-only. In monoscopic mode, the right eye projection matrix is ignored.

Parameters:
projection - the new right eye projection transform
Throws: RestrictedAccessException
if compatibility mode is disabled.
 o getLeftProjection
 public final void getLeftProjection(Transform3D projection)
Retrieves the current projection transform for the left eye and places it into the specified object.

Parameters:
projection - the Transform3D object that will receive the projection
 o getRightProjection
 public final void getRightProjection(Transform3D projection)
Retrieves the current projection transform for the right eye and places it into the specified object.

Parameters:
projection - the Transform3D object that will receive the projection
 o setVpcToEc
 public final void setVpcToEc(Transform3D vpcToEc)
Compatibility mode method that specifies the ViewPlatform Coordinates (VPC) to Eye Coordinates (EC) transform. If compatibility mode is disabled, then this transform is derived from other values and is read-only.

Parameters:
vpcToEc - the new VPC to EC transform
Throws: RestrictedAccessException
if compatibility mode is disabled.
 o getVpcToEc
 public final void getVpcToEc(Transform3D vpcToEc)
Retrieves the current ViewPlatform Coordinates (VPC) system to Eye Coordinates (EC) transform and copies it into the specified object.

Parameters:
vpcToEc - the object that will receive the vpcToEc transform.
 o setPhysicalBody
 public final void setPhysicalBody(PhysicalBody physicalBody)
Sets the view model's physical body to the PhysicalBody object provided. Java 3D uses the parameters in the PhysicalBody to ensure accurate image and sound generation when in head-tracked mode.

Parameters:
physicalBody - the new PhysicalBody object
 o getPhysicalBody
 public final PhysicalBody getPhysicalBody()
Returns a reference to the view model's PhysicalBody object.

Returns:
the view object's PhysicalBody object
 o setPhysicalEnvironment
 public final void setPhysicalEnvironment(PhysicalEnvironment physicalEnvironment)
Sets the view model's physical environment to the PhysicalEnvironment object provided.

Parameters:
physicalEnvironment - the new PhysicalEnvironment object
 o getPhysicalEnvironment
 public final PhysicalEnvironment getPhysicalEnvironment()
Returns a reference to the view model's PhysicalEnvironment object.

Returns:
the view object's PhysicalEnvironment object
 o setFieldOfView
 public final void setFieldOfView(double fieldOfView)
Sets the field of view used to compute the projection transform. This is used when head tracking is disabled and when the Canvas3D's windowEyepointPolicy is RELATIVE_TO_FIELD_OF_VIEW.

Parameters:
fieldOfView - the new field of view
 o getFieldOfView
 public final double getFieldOfView()
Returns the current field of view.

Returns:
the current field of view
 o setFrontClipDistance
 public final void setFrontClipDistance(double distance)
Sets the view model's front clip distance. This value specifies the distance away from the clip origin in the direction of gaze where objects stop disappearing. Objects closer than the clip origin offset by the front clip distance are not drawn.

Parameters:
distance - the new front clip distance
See Also:
setBackDistance
 o getFrontClipDistance
 public final double getFrontClipDistance()
Returns the view model's front clip distance.

Returns:
the current front clip distance
 o setBackClipDistance
 public final void setBackClipDistance(double distance)
Sets the view model's back clip distance. The parameter specifies the distance from the clip origin in the direction of gaze to where objects begin disappearing. Objects farther away than the clip-origin offset by the back-clip-distance are not drawn.

Note that this attribute is only used if there is no Clip node that is in scope of the view platform associated with this view.

Parameters:
distance - the new back clip distance
See Also:
setBackDistance
 o getBackClipDistance
 public final double getBackClipDistance()
Returns the view model's back clip distance.

Returns:
the current back clip distance
 o getUserHeadToVworld
 public final void getUserHeadToVworld(Transform3D t)
Retrieves the user-head to virtual-world transform and copies that value into the transform provided.

Parameters:
t - the Transform3D object that will receive the transform
 o getUserHeadToTrackerBase
 public final void getUserHeadToTrackerBase(Transform3D t)
Retrieves the user-head to the head-tracker-base transform and copies that value into the specified Transform3D object. If a head tracker is not present, this matrix is not updated. If a head tracker is present, the system updates this matrix with information about the user's current head position and orientation.

Parameters:
t - the object that will receive the transform
 o setFrontClipPolicy
 public final void setFrontClipPolicy(int policy)
Sets the view model's front clip policy, the policy Java 3D uses in computing where to place the front clip plane. The variable can contain one of:

Parameters:
policy - the new policy, one of PHYSICAL_EYE, PHYSICAL_SCREEN, VIRTUAL_EYE, or VIRTUAL_SCREEN
 o getFrontClipPolicy
 public final int getFrontClipPolicy()
Returns the view model's current front clip policy.

Returns:
one of: PHYSICAL_EYE, PHYSICAL_SCREEN, VIRTUAL_EYE, or VIRTUAL_SCREEN
 o setBackClipPolicy
 public final void setBackClipPolicy(int policy)
Sets the view model's back clip policy, the policy Java 3D uses in computing where to place the back clip plane. The variable can contain one of:

Parameters:
policy - the new policy, one of PHYSICAL_EYE, PHYSICAL_SCREEN, VIRTUAL_EYE, or VIRTUAL_SCREEN
 o getBackClipPolicy
 public final int getBackClipPolicy()
Returns the view model's current back clip policy.

Returns:
one of: PHYSICAL_EYE, PHYSICAL_SCREEN, VIRTUAL_EYE, or VIRTUAL_SCREEN
 o setTrackingEnable
 public final void setTrackingEnable(boolean flag)
Turns tracking on or off.

Parameters:
flag - enabling the display of tracking
 o getTrackingEnable
 public final boolean getTrackingEnable()
Returns a status flag indicating whether or not tracking is enabled.

Returns:
a flag telling whether tracking is enabled
 o setUserHeadToVworldEnable
 public final void setUserHeadToVworldEnable(boolean flag)
Turns on or off the continuous updating of the userHeadToVworld transform.

Parameters:
flag - enables or disables continuous updating
 o getUserHeadToVworldEnable
 public final boolean getUserHeadToVworldEnable()
Returns a status flag indicating whether or not Java 3D is continuously updating the userHeadToVworldEnable transform.

Returns:
a flag indicating if continuously updating userHeadToVworld
 o getSensorToVworld
 public final void getSensorToVworld(Sensor sensor,
                                     Transform3D t)
Computes the sensor to virtual-world transform and copies that value into the transform provided. The computed transforms takes points in the sensor's coordinate system and produces the point's corresponding value in virtual-world coordinates.

Parameters:
sensor - the sensor in question
t - the object that will receive the transform
 o getSensorHotspotInVworld
 public final void getSensorHotspotInVworld(Sensor sensor,
                                            Point3f position)
Retrieves the position of the specified Sensor's last known hotspot position in virtual-world coordinates and copies that value into the vector provided. This value is derived from other values and is read-only.

Parameters:
sensor - the sensor in question
position - the vector that will receive the position
 o getSensorHotspotInVworld
 public final void getSensorHotspotInVworld(Sensor sensor,
                                            Point3d position)
Retrieves the position of the specified Sensor's last known hotspot position in virtual-world coordinates and copies that value into the vector provided. This value is derived from other values and is read-only.

Parameters:
sensor - the sensor in question
position - the vector that will receive the position
 o setCanvas3D
 public final void setCanvas3D(Canvas3D canvas3D,
                               int index)
Sets given canvas3D at the given index position.

Parameters:
canvas3D - the given canvas3D to be set
index - the position to be set
 o getCanvas3D
 public final Canvas3D getCanvas3D(int index)
Gets the canvas3D from the given index position.

Parameters:
index - the position from which to get Canvas3D object
Returns:
canvas3D the canvas3D at index position
 o getAllCanvas3Ds
 public final Enumeration getAllCanvas3Ds()
Gets the enumeration object of all the canvas3Ds.

Returns:
the enumeration object of all the canvas3Ds.
 o addCanvas3D
 public final void addCanvas3D(Canvas3D canvas3D)
Adds the given canvas3D at the end of the list.

Parameters:
canvas3D - the canvas3D to be added
 o insertCanvas3D
 public final void insertCanvas3D(Canvas3D canvas3D,
                                  int index)
Inserts the canvas3D at the given index position.

Parameters:
canvas3D - the canvas3D to be inserted
index - the position to be inserted at
 o removeCanvas3D
 public final void removeCanvas3D(int index)
Removes the canvas3D from the given index position.

Parameters:
index - the position of Canvas3D object to be removed
 o removeCanvas3D
 public final void removeCanvas3D(Canvas3D canvas3D)
Removes the given canvas3D.

Parameters:
canvas3D - the canvas3D to be removed
 o getCurrentFrameStartTime
 public long getCurrentFrameStartTime()
This method returns the time at which the most recent rendering frame started. It is defined as the number of milliseconds since January 1, 1970 00:00:00 GMT. Since multiple canvases might be attached to this View, the start of a frame is defined as the point in time just prior to clearing any canvas attached to this view.

Returns:
the time at which the most recent rendering frame started
 o getLastFrameDuration
 public long getLastFrameDuration()
This method returns the duration, in milliseconds, of the most recently completed rendering frame. The time taken to render all canvases attached to this view is measured. This duration is computed as the difference between the start of the most recently completed frame and the end of that frame. Since multiple canvases might be attached to this View, the start of a frame is defined as the point in time just prior to clearing any canvas attached to this view, while the end of a frame is defined as the point in time just after swapping the buffer for all canvases.

Returns:
the duration, in milliseconds, of the most recently completed rendering frame
 o setDepthBufferFreezeTransparent
 public final void setDepthBufferFreezeTransparent(boolean flag)
Enables or disables automatic freezing of the depth buffer for objects rendered during the transparent rendering pass (i.e., objects rendered using alpha blending) for this view. If enabled, depth buffer writes will be disabled during the transparent rendering pass regardless of the value of the depth buffer write enable flag in the RenderingAttributes object for a particular node. This flag is enabled by default.

Parameters:
flag - indicates whether automatic freezing of the depth buffer for transparent/antialiased objects is enabled.
See Also:
setDepthBufferWriteEnable
 o getDepthBufferFreezeTransparent
 public final boolean getDepthBufferFreezeTransparent()
Retrieves the current value of the depth buffer freeze transparent flag for this view.

Returns:
a flag that indicates whether or not the depth buffer is automatically frozen during the transparent rendering pass.
 o setSceneAntialiasingEnable
 public final void setSceneAntialiasingEnable(boolean flag)
Enables or disables scene antialiasing for this view. If enabled, the entire scene will be antialiased on each canvas in which scene antialiasing is available. Scene antialiasing is disabled by default.

Parameters:
flag - indicates whether scene antialiasing is enabled
 o getSceneAntialiasingEnable
 public final boolean getSceneAntialiasingEnable()
Returns a flag that indicates whether or not scene antialiasing is enabled for this view.

Returns:
a flag that indicates whether scene antialiasing is enabled
 o setLocalEyeLightingEnable
 public final void setLocalEyeLightingEnable(boolean flag)
Sets a flag that indicates whether the local eye point is used in lighting calculations for perspective projections. If this flag is set to true, the view vector is calculated per-vertex based on the direction from the actual eye point to the vertex. If this flag is set to false, a single view vector is computed from the eye point to the center of the view frustum. This is called infinite eye lighting. Local eye lighting is disabled by default, and is ignored for parallel projections.

Parameters:
flag - indicates whether local eye lighting is enabled
 o getLocalEyeLightingEnable
 public final boolean getLocalEyeLightingEnable()
Retrieves a flag that indicates whether or not local eye lighting is enabled for this view.

Returns:
a flag that indicates whether local eye lighting is enabled
 o attachViewPlatform
 public final void attachViewPlatform(ViewPlatform vp)
Attach viewPlatform structure to this view.

Parameters:
vp - the viewPlatform to be attached

All Packages  Class Hierarchy  This Package  Previous  Next  Index