Post

Viewport

Overview

Viewport is a Grouping node that can contain most nodes. Viewport specifies a set of rectangular clip boundaries against which the children nodes are clipped as they are rendered.

The Viewport node belongs to the Layering component and requires at least level 1, its default container field is viewport. It is available from X3D version 3.2 or higher.

Hierarchy

1
2
3
4
5
+ X3DNode
  + X3DChildNode
    + X3DGroupingNode
      + X3DViewportNode
        + Viewport (X3DBoundedObject)*

* Derived from multiple interfaces.

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

MFFloat [in, out] clipBoundary [ 0, 1, 0, 1 ] [0,1]

clipBoundary is specified in fractions of the normal render surface in the sequence left/right/bottom/top. When children are rendered, the output will only appear in the specified subset of the render surface.

Hint

  • Default value 0 1 0 1 indicates 0-1 left-to-right and 0-1 bottom-to-top, meaning full view.

SFBool [in, out] visible TRUE

Whether or not renderable content within this node is visually displayed.

Hints

  • The visible field has no effect on animation behaviors, event passing or other non-visual characteristics.
  • Content must be visible to be collidable and to be pickable.

SFBool [in, out] bboxDisplay FALSE

Whether to display bounding box for associated geometry, aligned with world coordinates.

Hint

  • The bounding box is displayed regardless of whether contained content is visible.

SFVec3f [ ] bboxSize -1 -1 -1 [0,∞) or −1 −1 −1

Bounding box size is usually omitted, and can easily be calculated automatically by an X3D player at scene-loading time with minimal computational cost. Bounding box size can also be defined as an optional authoring hint that suggests an optimization or constraint.

Hints

SFVec3f [ ] bboxCenter 0 0 0 (-∞,∞)

Bounding box center accompanies bboxSize and provides an optional hint for bounding box position offset from origin of local coordinate system.

Hints

MFNode [in] addChildren

Input field addChildren.

MFNode [in] removeChildren

Input field removeChildren.

MFNode [in, out] children [ ] [X3DChildNode]

Grouping nodes contain an ordered list of children nodes.

Hints

  • Each grouping node defines a coordinate space for its children, relative to the coordinate space of its parent node. Thus transformations accumulate down the scene graph hierarchy.
  • InputOnly MFNode addChildren field can append new X3DChildNode nodes via a ROUTE connection, duplicate input nodes (i.e. matching DEF, USE values) are ignored.
  • InputOnly MFNode removeChildren field can remove nodes from the children list, unrecognized input nodes (i.e. nonmatching DEF, USE values) are ignored.
  • X3D Architecture 10.2.1 Grouping and children node types

Example

View Source in Playground

See Also

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