1
1. X3D system architecture overview
Conceptually, each X3D application is a 3D time-based space that contains graphic and aural objects that can be loaded over a network and dynamically modified through a variety of mechanisms. The semantics of X3D describe an abstract functional behaviour of time-based, interactive 3D, multimedia information. X3D does not define physical devices or any other implementation-dependent concepts (e.g., screen resolution and input devices). X3D is intended for a wide variety of devices and applications, and provides wide latitude in interpretation and implementation of the functionality. For example, X3D does not assume the existence of a mouse or 2D display device.
Each X3D application:
- implicitly establishes a world coordinate space for all objects defined, as well as all objects included by the application;
- explicitly defines and composes a set of 2D, 3D and multimedia objects;
- can specify hyperlinks to other files and applications;
- can define object behaviours;
- can connect to external modules or applications via programming and scripting languages.
2. Conceptual execution model
3. Components
- Core component provides a detailed specification of the Core component of X3D.
- Time component provides a detailed specification of the Time component of X3D.
- Grouping component provides a detailed specification of the Grouping component of X3D.
- Rendering component provides a detailed specification of the Rendering component of X3D.
- Shape component provides a detailed specification of the Shape component of X3D.
- Geometry3D component provides a detailed specification of the Geometry3D component of X3D.
- Geometry2D component provides a detailed specification of the Geometry2D component of X3D.
- Text provides a detailed specification of the Text component of X3D.
- Sound component provides a detailed specification of the Time component of X3D.
- Lighting component provides a detailed specification of the Lighting component of X3D.
- Texturing component provides a detailed specification of the Texturing component of X3D.
- Interpolation component provides a detailed specification of the Interpolation component of X3D.
- Pointing device sensor component provides a detailed specification of the Pointing device sensor component of X3D.
- Key device sensor component provides a detailed specification of the Key device sensor component of X3D.
- Navigation component provides a detailed specification of the Navigation component of X3D.
- Environmental sensor component provides a detailed specification of the Environmental sensor component of X3D.
- Environmental effects component provides a detailed specification of the Environmental effects component of X3D.
- Geospatial component provides a detailed specification of the Geospatial component of X3D.
- Humanoid animation component provides a detailed specification of the Humanoid animation component of X3D.
- NURBS component provides a detailed specification of the NURBS component of X3D.
- DIS component provides a detailed specification of the DIS component of X3D.
- Scripting component provides a detailed specification of the Scripting component of X3D.
- VRML 97 scripting component provides a detailed specification of the VRML 97 scripting component of X3D.
- Event utilities component provides a detailed specification of the Event utilities component of X3D.
4. Profiles
There are several annexes included in the specification:
- Core proflie defines a minimal subset of X3D functionality that contstitutes the Core profile.
- Interchange profile defines the proper subset of X3D functionality that constitutes the Interchange profile.
- Interactive profile defines the proper subset of X3D functionality that constitutes the Interactive profile.
- MPEG-4 interactive profile defines the proper subset of X3D functionality that constitutes the MPEG-4 interactive profile (MPEG = Moving Picture Experts Group)
- Immersive profile defines the proper subset of X3D functionality that constitutes the VRML 97 base profile.
- Full profile defines the proper subset of X3D functionality that constitutes the Full profile.
- Recommended navigation behaviours specifies some recommended behaviours that may be adopted by browser implementers.
27. NURBS component
27.1 Introduction
27.1.2 Overview
This subclause describes the Non-uniform Rational B-Spline (NURBS) component of this part of ISO/IEC 19775. The following provides links to the major topics in this subclause.
Table 27.1 — Topics in this subclause
- 27.1 Introduction
- 27.1.1 Name
- 27.1.2 Overview
- 27.2 Concepts
- 27.2.1 Overview of NURBS
- 27.2.2 NURBS-related nodes
- 27.2.3 Tessellation strategies
- 27.2.4 Automatic level of detail
- 27.2.5 Trimmed NURBS
- 27.2.6 Using NURBS for animation
- 27.3 Abstract types
- 27.3.1 X3DParametricGeometryNode
- 27.4 Node reference
- 27.4.1 Contour2D
- 27.4.2 ContourPolyline2D
- 27.4.3 CoordinateDeformer
- 27.4.4 NurbsCurve
- 27.4.5 NurbsCurve2D
- 27.4.6 NurbsGroup
- 27.4.7 NurbsPositionInterpolator
- 27.4.8 NurbsSurface
- 27.4.9 NurbsTextureSurface
- 27.4.10 TrimmedSurface
- 27.5 Support levels
- Table 27.1 — Topics in this clause
- Table 27.2 — NURBS component support levels
27.2 Concepts
27.2.1 Overview of NURBS
Non-uniform Rational B-Splines provide a convenient and efficient manner to generate curved lines and surfaces which can be smooth at any viewing distance. Since these surfaces are generated parametrically, only a small amount of data need be provided for describing complex surfaces.
27.2.2 NURBS-related nodes
The characteristics of a NurbsSurface and a NurbsCurve are determined by a set of control points (control vertices, CV) similar to an ElevationGrid. These points are approximated to a certain degree that is defined in the weight value of every CV. The whole surface can be seen as the weighted average of all control points with the control points having only strong influence in their periphery. The range of the influence is determined by the knot vector.
There are many surface construction techniques including:
- special cases of NURBS surfaces such as sphere, cylinder or Bezier surfaces;
- Extrusion / swept surfaces, constructed given a spine and a cross section curve which both can be NURBS curves;
- surfaces of revolution, constructed given a circle/arc and a NURBS cross section curve;
- skinned surface constructed from a set of curves;
- Gordon surfaces interpolating two sets of curves;
- Coons patches, a bicubic blended surface constructed from 4 border curves;
- Surfaces interpolating a set of points.
For this standard, it is assumed that creation of such surfaces is only a construction step at authoring time and that the surface will be represented as a general NurbsSurface for X3D runtime delivery.
27.2.3 Tessellation strategies
Because low-level real-time rendering systems currently can handle only planar triangles, a NURBS surface needs to be broken down (i.e., tessellated) into a set of triangles approximating the true surface.
Tessellation can be done in different coordinate spaces:
- Tessellation in object space and the internal computation of the equivalent to an X3D IndexedFaceSet.
- Transforming the control vertices to screen space, and tessellation in screen space
There are different methods to determine tessellation points on the surface:
- fixed tessellation based on a absolute number of subdivisions;
- adaptive tessellation based on chord length;
- adaptive tessellation based on the angle between two triangles;
- view dependent tessellation, fine tessellation near silhouette edges.
This standard does not specify which method is used to tessellate the surface. However, the implementation shall render the NURBS such that the approximation produces a rendered image which in which the edges of the tessellation can not be perceived.
It should be noted that tessellation in screen space requires the ability to pass already transformed vertices for rendering. This requires the application to already light the vertices (see 17, Lighting component) and pass the resulting color and specular RGB values for each vertex of a triangle.
In order to avoid cracks at the junction of two surfaces, tessellation values of a whole set of surfaces can be specified in a NurbsGroup.
27.2.4 Automatic level of detail
By taking advantage of the totally flexible tessellation of NURBS models, new ways of LOD can occur. Dependent on various parameters, the output of the tesselation process is adapted in every frame. This trade off between quality of the rendered model and the frame-rate can take into account:
- required target frame rate;
- available triangle budget per frame/object;
- number of triangles of the last frame/object;
- available CPU performance;
- distance of object to viewer;
- number of current visible NurbsSurfaces;
- area of control point grid projected to screen space / area of the bounding box of the control point grid projected to screen space.
It is not required that such automatic LOD be supported.
27.2.5 Trimmed NURBS
The trimming curve specifies a NURBS-curve that limits the NURBS surface in order to create NURBS surfaces that contain holes or have smooth boundaries. Trimming curves are curves in the parametric space of the surface. The following defines trimming:
A trimming region is defined by a set of closed trimming loops in the parameter space of a surface. When a loop is oriented counter-clockwise, the area within the loop is retained, and the part outside is discarded. When the loop is oriented clockwise, the area within the loop is discarded, and the rest is retained. Loops may be nested, but a nested loop must be oriented oppositely from the loop that contains it. The outermost loop must be oriented counter-clockwise.
A trimming loop consists of a connected sequence of NURBS curves and piece-wise linear curves. The last point of every curve in the sequence must be the same as the first point of the next curve, and the last point of the last curve must be the same as the first point of the first curve. Self intersecting curves are not allowed.
27.2.6 Using NURBS for animation
NURBS can be simply animated through alteration of single control vertices. Thereby the NURBS surface will always keep its smoothness. By changing the order of the surface, the impact of the CV-animation on adjacent control points and so the range of the animation can be changed.
NURBS are also applicable for the animation of values using smooth curves expressed in NURBS format. An adaption of the PositionInterpolator node type to a NURBS description leads to the NurbsPositionInterpolator.
Extending the concept NurbsCurve (one Parameter), NurbsSurface (two parameters) to the parametric dimension 3 results in a NurbsVolume. So given a (u,v,w) parameter as input a 3D (x,y,z) output can be computed. The CoordinateDeformer defines a volume and applies a space warp to this volume. Any given conventional X3D node can be deformed by this node.
27.3 Abstract types
27.3.1 X3DParametricGeometryNode
X3DParametricGeometryNode : X3DGeometryNode {
}
This abstract node type is the base type for all geometry node types that are created parametrically.
27.4 Node reference
27.4.1 Contour2D
Contour2D : X3DGroupingNode, X3DBoundedNode {
MFNode [in] addChildren [NurbsCurve|ContourPolyline2D]
MFNode [in] removeChildren [NurbsCurve|ContourPolyline2D]
MFNode [in,out] children [] [NurbsCurve|ContourPolyline2D]
}
The Contour2D node groups a set of curve segments to a composite contour. The children shall form a closed loop with the first point of the first child repeated as the last point of the last child and the last point of a segment repeated as the first point of the consecutive one. The segments shall be defined either by NurbsCurve2D or ContourPolyline2D nodes and shall be enumerated in the child field in consecutive order according to the topology of the contour.
Nested Contour2D nodes alternately specify invalid and valid regions depending on the clockwiseness of the contours. Additionally, each Contour2D may contain multiple, non-intersecting Contour2D nodes. This allows specification of multiple invalid or valid regions within a single outerlying valid or invalid region. See 27.2.5 Trimmed NURBS for a description of how clockwiseness is computed.
27.4.2 ContourPolyline2D
ContourPolyline2D : X3DParametricGeometryNode {
MFVec2f [in,out] point [] (-∞,∞);
}
The ContourPolyline2D node defines a piecewise linear curve segment as a part of a trimming contour in the u-v domain of a surface.
point specifies the end points of the piecewise linear curve.
ContourPolyline2D are used as children to the Contour2D group.
27.4.3 CoordinateDeformer
CoordinateDeformer : X3DGroupingNode, X3DBoundedNode {
MFNode [in] addChildren [X3DShapeNode]
MFNode [in] removeChildren [X3DShapeNode]
MFNode [in,out] children [] [X3DShapeNode]
MFVec3f [in,out] controlPoint []
MFNode [in,out] inputCoord [] [Coordinate]
MFNode [in,out] inputTransform [] [Transform]
MFNode [in,out] outputCoord [] [Coordinate]
MFFloat [in,out] weight [] (-∞,∞)
SFVec3f [] bboxCenter 0 0 0 (-∞,∞)
SFVec3f [] bboxSize -1 -1 -1 (0,∞) or -1 -1 -1
SFInt32 [] uDimension 0 (0,∞)
MFDouble [] uKnot [] (-∞,∞)
SFInt32 [] uOrder 2 (2,∞)
SFInt32 [] vDimension 0 (0,∞)
MFDouble [] vKnot [] (-∞,∞)
SFInt32 [] vOrder 2 (2,∞)
SFInt32 [] wDimension 0 (0,∞)
MFFloat [] wKnot [] (-∞,∞)
SFInt32 [] wOrder 2 (2,∞)
}
CoordinateDeformer allows a free form deformation on a set of MFVec3f Coordinate nodes by using a NURBS volume. Conceptually, a set of input Coordinate nodes is placed into a non-uniform grid volume. If the grid control points are animated or deformed the output Coordinate nodes are updated accordingly.
The input to the deformer is a list of Coordinate nodes, where each Coordinate node defines a 3D parameter (u,v,w) for evaluation. The corresponding Cartesian output value is computed from the NURBS control grid. The children node contains a scene graph that typically consists of IndexedFaceSet nodes referring to a deformed Coordinate node in outputCoords.
The uDimension, vDimension, wDimension, controlPoint, weight, uKnot, vKnot, wKnot, uOrder, vOrder, and wOrder fields define the NURBS in three dimensions. The definition is similar to the NurbsSurface node.
The inputCoord field, if specified, shall contain a set of Coordinate nodes.
The outputCoord field, shall contain a set of Coordinate nodes. The number of nodes shall be equal to the number of nodes in inputCoord. The nodes themselves should be distinct from nodes in inputCoords.
The inputTransform field, if specified, shall contain a set of Transform nodes, the number of nodes shall be equal to the number of nodes in inputCoord.
By animating the controlPoint field, IndexedFaceSet nodes using a Coordinate node from outputCoords are deformed over time. Similarly, the point field in an input Coordinate node can be animated. By changing a Transform node in the inputTransform parameter, geometry can be moved through the deformation space (space warp).
CoordinateDeformer is a group node and shall be part of the transform hierarchy if evaluation is required. Points in the Coordinate node contained in outputCoord are recomputed and updated whenever the points of the inputCoord Coordinate are changed, any exposedField of the CoordinateDeformer itself is changed, or if any of the supplied inputTransform nodes are changed. Implementations may defer or even skip evaluation until the CoordinateDeformer node is displayed; i.e., if the node is not currently part of the traversed scene graph, or the node is not being rendered because the bounding box of the node (or the bounding box computed from the controlPoint list) falls outside the view frustum.
In some respects, CoordinateDeformer is a special version of a CoordinateInterpolator. The CoordinateDeformer is a group node in order to make the animation locatable in the scene graph at a certain 3D position. Normally, VRML interpolators do not define a bounding box and so are not culled from the scene. This behaviour may be achieved explicitly by routing the output of a VisibilitySensor to the controlling TimeSensor node.
The following is an example of this node:
DEF FFD CoordinateDeformer {
controlPoint [ ..... ]
inputCoord DEF inputCoord
Coordinate { point [ ...] }
outputCoord DEF outputCoord
Coordinate { point [] }
children Shape {
geometry IndexedFaceSet {
coord USE outputCoord
coordIndex [ .... ]
}
}
}
... # additional code to animate the FFDGrid goes here
DEF Timer TimeSensor {}
DEF FFDGridInterpolator CoordinateInterpolator { ..... }
ROUTE FFDGridInterpolator.value_changed TO FFD.set_controlPoint
ROUTE Timer.fraction_changed O FFDGridInterpolator.set_fraction
If a given input coordinate value (optionally transformed by the matrix of the corresponding Transform node) exceeds the parametric range of one of the knot vectors, the corresponding output coordinate value will be left unchanged. This is useful to deform only a subset of the coordinates or to animated different parts of the coordinate node by different CoordinateDeformerGroup nodes.
The following pseudo- code formulates the operation of this node:
function PerformDeformation() {
for (n=0; n<inputCoords.length;i++) {
Deform(inputCoord[i].point,MatrixOf(inputTransform[i]),outputCoord[i].point);
}
}
function Deform(MFVec3f input, Matrix m, MFVec3f output)
if (output.length < input.length) output.length = input.length;
for (i=0; i<input.length;i++) {
SFVec3f parameter = m * input[i];
if (ParameterInRange(parameter)) {
output[i] = NurbsEvaluate3(parameter);
}
}
}
Vec3f NurbsEvaluate3(SFVec3f parameter)
-- evaluate standard NURBS formula
27.4.4 NurbsCurve
NurbsCurve : X3DParametricGeometryNode {
MFVec3f [in,out] controlPoint [] (-∞,∞)
SFInt32 [in,out] tessellation 0 (-∞,∞)
MFDouble [in,out] weight [] (0,∞)
MFDouble [] knot [] (-∞,∞)
SFInt32 [] order 3 [2,∞)
}
The NurbsCurve node is a geometry node defining a parametric curve.
Order defines the order of curve. From a mathematical point of view, the curve is defined by a polynomial of the degree order-1. The value of Order shall be greater than or equal to 2. An implementation may limit Order to a certain number. The most common orders are 3 (quadratic polynomial) and 4 (cubic polynomial), which are sufficient to achieve the desired curvature in most cases. The number of control points shall be at least equal to the order of the curve. The order defines the number of adjacent control points that influence a given control point.
The control points define a piecewise linear curve, where the points do not have a uniform spacing. Depending on the weight value and the order, this piecewise linear curve is approximated by the resulting parametric curve. The number of control points shall be equal to or greater than the order. The control points are all defined as 3D vertices in the x, y, z domain. A closed B-Spline curve can be specified by repeating the limiting control points and by specifying a periodic knot vector.
A weight value that shall be greater than zero is assigned to each controlPoint. The ordering of the values is equivalent to the ordering of the control point values. If the weight of a control point increased above 1, the point is more closely approximated by the curve. However the curve is not changed if all weights are multiplied by a common factor. The number of values shall be identical to the number of control points. If the length of the weight vector is 0, the default weight 1.0 is assumed for each control point.
As a result of the lack of a 4D Coordinate field type in VRML, the control points and the corresponding weight values are held in separate fields. This separation also allows independent animation of the controlPoint fields using a CoordinateInterpolator node.
knots defines the knot vector. The number of knots shall be equal to the number of control points plus the order of the curve. The order shall be non-decreasing. By setting successive knot values equal, the degree of continuity is decreased, which implies that the curve has corners. In general, the curve is of continuity Ck-1-m at a knot point, where k is the order and m is the number of consecutive knots being equal. If k is the order of the curve, k consecutive knots at the end or the beginning of the vector cause the curve to interpolate the last or the first control point respectively. Within the knot vector there may not be more than k-1 consecutive knots of equal value. If the length of a knot vector is 0, a default uniform knot vector is computed.
The tessellation field gives a hint to the curve tessellator by setting an absolute number of subdivision steps. These values shall be greater than or equal to the Order field. A value of 0 indicates that the browser choose a suitable tessellation. Interpretation of values below 0 is implementation dependent.