← Users | Developers → | |||||||||||||||||||

Intro | News | view3dscene | The Castle | All Programs | Forum | Donate | Engine | VRML/X3D | Blender |

## NURBS componentThis component defines nodes for rendering and animating along smooth NURBS curves and surfaces. See also X3D specification of NURBS component. Contents: ## 1. DemosFor demos and tests of these features,
see the ## 2. X3D supportFull support for Any >= 2 value of order is allowed (X3D spec requires only 2,3,4 support).
## 3. VRML 2.0 (97) supportAlso basic VRML 97 NURBS nodes (defined in VRML 97 versions are similar, but not 100% the same as their X3D counterparts. Only X3D surfaces have `xClosed`fields. We treat TRUE value there as "possibly closed", that is — if field indicates closed, we still check if limiting points match (X3D spec suggests we should do this, as far as I understand). This means X3D models may be loaded faster — if xClosed = FALSE, we do not even check if limiting points match.Only VRML 97 surfaces have `ccw`field.VRML 97 versions specify `coord`as direct`MFVec3f`field, while X3D versions specify`coord`as`SFNode`(containing`Coordinate`or similar node).VRML 97 `NurbsPositionInterpolator`has different field names (keyValue, keyWeight, following interpolator conventions) than X3D`NurbsPositionInterpolator`(controlPoint, weight, following nurbs conventions).VRML 97 `NurbsPositionInterpolator`has different default value for order (4) than X3D version (3). Beware of this when converting from VRML 97 to X3D.In VRML 97, `knot`and`weight`data is`MFFloat`, single-precision. In X3D, it's`MFDouble`.
## 4. Control points are in homogeneous coordinatesNote that in VRML and X3D, NURBS control points are expressed in
homogeneous coordinates. That is, the control point is actually
a 4D vector This may be a little confusing, if you're used to normal NURBS equation definition like from here or at wikipedia. Instead of usual equation: P(u) = (sum of basis * control point * weight) / (sum of basis * weight) VRML/X3D uses a simpler equation: P(u) = (sum of basis * control point) / (sum of basis * weight) That is, If you want to intuitively pull the curve toward the control point, you should - Calculate
*"normal control point"*(3D, not in homogeneous coordinates) as*"X3D control point / weight"*. - Increase the weight (to pull the curve toward
*"normal control point"*), or decrease (to push the curve away from it). - Calculate new
*"X3D control point"*as*"normal control point * new weight"*.
In other words, if you just want to increase the weight 2 times, then the corresponding control point should also be multiplied * 2, to make things behave intuitive. In particular, when writing an exporter from normal 3D modelling programs,
like Blender, note that you have
to multiply Blender control points * Blender weights to get correct
X3D control points. When you use White Dune,
a NURBS 3D modeller especially suited for working with VRML/X3D,
this non-intuitive behevior is somewhat hidden (the curve "handles"
you see in White Dune are actually Our behavior is compatible with other X3D browsers/editors (at least White Dune, Octaga, InstantPlayer, BitManagement). |