Post

Viewpoint

Viewpoint

Overview

Viewpoint provides a specific location and direction where the user may view the scene. Viewpoints are the primary way for a user to navigate within a scene, and for an author to show critical aspects of a model. Unless modified by the orientation field, the default direction for a Viewpoint to look is along the -Z axis.

The Viewpoint node belongs to the Navigation component and requires at least level 1, its default container field is children. It is available since VRML 2.0 and from X3D version 3.0 or higher.

Hierarchy

1
2
3
4
5
+ X3DNode
  + X3DChildNode
    + X3DBindableNode
      + X3DViewpointNode
        + Viewpoint

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

SFBool [in] set_bind

Sending event set_bind=true makes this node active. Sending event set_bind=false makes this node inactive. Thus setting set_bind to true/false will pop/push (enable/disable) this Viewpoint.

Hint

  • Paired node operations can be established by connecting set_bind and isBound fields of corresponding bindable nodes.

Warning

  • It is an error to define this transient inputOnly field in an X3D file, instead only use it a destination for ROUTE events.

SFString [in, out] description “”

Text description or navigation hint to describe the significance of this model Viewpoint.

Hints

  • A sequence of good Viewpoints with understandable descriptions can provide a guided tour of a model.
  • The currently bound NavigationInfo node has a major effect on how a user might change viewing position and orientation after reaching this Viewpoint.
  • Consider paired Viewpoint/NavigationInfo node combinations by defining ROUTE connections between corresponding isBound/set_bind fields.
  • Include space characters since a description is not a DEF identifier. Write short phrases that make descriptions clear and readable.
  • Many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for “ quotation-mark character).

Warning

  • Without description, this Viewpoint is unlikely to appear on browser Viewpoint menus.

SFVec3f [in, out] position 0 0 10 (-∞,∞)

position (x, y, z in meters) relative to local coordinate system.

SFRotation [in, out] orientation 0 0 1 0 [-1,1],(-∞,∞)

Rotation (axis, angle in radians) of Viewpoint, relative to default -Z axis direction in local coordinate system.

Hints

  • This is orientation change from default direction (0 0 -1) along the -X axis.
  • Complex rotations can be accomplished axis-by-axis using parent Transforms.

Warning

  • For VR/AR/MR/XR users wearing a head-mounted display (HMD), animating this field may induce motion sickness.

SFVec3f [in, out] centerOfRotation 0 0 0 (-∞,∞)

centerOfRotation specifies center point about which to rotate user’s eyepoint when in EXAMINE or LOOKAT mode.

SFFloat [in, out] fieldOfView π/4 (0,π)

Preferred minimum viewing angle from this viewpoint in radians, providing minimum height or minimum width (whichever is smaller). Small field of view roughly corresponds to a telephoto lens, large field of view roughly corresponds to a wide-angle lens.

Hints

  • Modifying Viewpoint distance to object may be better for zooming.
  • This field may be ignored, applying the default value regardless.

Warnings

  • fieldOfView may not be correct for different window sizes and aspect ratios.
  • For VR/AR/MR/XR users wearing a head-mounted display (HMD), animating this field may induce motion sickness. Interchange profile

SFFloat [in, out] nearDistance -1 -1 or (0,∞)

nearDistance defines minimum clipping plane distance necessary for object display.

Hints

  • Overrides bound NavigationInfo avatarSize value, if any.
  • Default value -1 means no effect on currently defined view frustum boundaries.
  • Aliasing and Clipping

Warning

  • nearDistance must be less than farDistance.

SFFloat [in, out] farDistance -1 -1 or (0,∞)

farDistance defines maximum clipping plane distance allowed for object display.

Hints

  • Overrides bound NavigationInfo visibilityLimit value, if any.
  • Default value -1 means no effect on currently defined view frustum boundaries.
  • Aliasing and Clipping

Warning

  • NearDistance must be less than farDistance.

SFBool [in, out] viewAll FALSE

Viewpoint is automatically adjusted to view all visible geometry. Typically centerOfRotation is shifted to center of current bounding box and view is zoomed in or out until all visible objects are viewed.

Hints

  • No collision detection or proximity sensing occurs when zooming.
  • When the value of the viewAll field is changed from TRUE to FALSE, no change in the current view occurs.

Warning

  • If needed, near and far clipping planes shall be adjusted to allow viewing the entire scene.

SFBool [in, out] jump TRUE

Transition instantly by jumping, otherwise smoothly adjust offsets in place when changing to this Viewpoint.

Hints

  • See NavigationInfo.transitionType for the manner in which animated Viewpoint transistions occur.
  • Set jump=true for instantaneous camera motion when going to this viewpoint.

Warning

  • For VR/AR/MR/XR users wearing head-mounted displays, animating transitions between viewpoints may induce motion sickness.

SFBool [in, out] retainUserOffsets FALSE

Retain (true) or reset to zero (false) any prior user navigation offsets from defined viewpoint position, orientation.

SFBool [out] isBound

Output event true gets sent when node becomes bound and activated, otherwise output event false gets sent when node becomes unbound and deactivated.

Hint

  • Paired node operations can be established by connecting set_bind and isBound fields of corresponding bindable nodes.

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

SFTime [out] bindTime

Event sent reporting timestamp when node becomes active/inactive.

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

SFNode [in, out] navigationInfo NULL [NavigationInfo]

The navigationInfo field defines a dedicated NavigationInfo node for this X3DViewpointNode. The specified NavigationInfo node receives a set_bind TRUE event at the time when the parent node is bound and receives a set_bind FALSE at the time when the parent node is unbound.

Hint

  • Allows simple integration of custom navigation associated with each Viewpoint according to user needs at that location.

Advice

Hints

  • A sequence of good Viewpoints with understandable descriptions can provide a guided tour of a model.
  • The currently bound NavigationInfo node has a major effect on how a user might change viewing position and orientation after reaching this Viewpoint.
  • Consider paired Viewpoint/NavigationInfo node combinations by defining ROUTE connections between corresponding isBound/set_bind fields.
  • Consider how users might interact with the current X3D model, either standalone or as an Inline within a larger parent scene.
  • Background, Fog, GeoViewpoint, NavigationInfo, OrthoViewpoint, TextureBackground and Viewpoint are bindable nodes, meaning that no more than one of each node type can be active at a given time.
  • GeoViewpoint OrthoViewpoint and Viewpoint share the same binding stack, so no more than one of these nodes can be bound and active at a given time.
  • Regardless of viewpoint jump value at bind time, the relative viewing transformation between user’s view and defined position/orientation is stored for later use when un-jumping (returning to the viewpoint when subsequent viewpoint is unbound).
  • Customizable design pattern for dedicated Viewpoint/NavigationInfo pair: <Viewpoint DEF=’SpecialView’/> <NavigationInfo DEF=’SpecialNav’/> <ROUTE fromNode=’SpecialView’ fromField=’isBound’ toNode=’SpecialNav’ toField=’set_bind’/>
  • X3D Scene Authoring Hints, Viewpoints

Warnings

Example

See Also

This post is licensed under CC BY 4.0 by the author.