| Nurbs |  |  |
NURBS in Cortona
|
Extending VRML standard ParallelGraphics realized support of a mathematical model for surfaces known as NURBS for Cortona VRML client 1.5+. With NURBS geometry, users can model complex sculptured shapes faster, more accurately, and with fewer surfaces.
For example, NURBS geometry makes it possible to treat the hood of an automobile or the wing of an airplane as a single surface and create more realistic shapes of human bodies.
With NURBS it is easier to create virtual worlds in VRML with smooth surfaces and reduced download size of VRML files because of the compact NURBS description at once.
|
Geometric NURBS node
NurbsSurface {
field SFInt32 uDimension 0
field SFInt32 vDimension 0
field MFFloat uKnot []
field MFFloat vKnot []
field SFInt32 uOrder 3
field SFInt32 vOrder 3
exposedField MFVec3f controlPoint []
exposedField MFFloat weight []
exposedField SFInt32 uTessellation 0
exposedField SFInt32 vTessellation 0
exposedField SFNode texCoord []
exposedField SFBool ccw TRUE
exposedField SFBool solid TRUE
exposedField MFFloat distance 10
exposedField MFFloat quality [0, 0.75]
}
|
| |

 |
uDimension and vDimension define the number of control points in the u and v dimensions.
|

| |

 |
uOrder and vOrder define the order of surface. From a mathematical point of view, the surface is defined by polynomials of the degree order-1.
The order of the curves uOrder and vOrder must be greater or equal to 2. An implementation may limit uOrder and vOrder 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 must 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.
|

| |

 |
controlPoint defines a set of control points of dimension uDimension * vDimension. This set of points defines a mesh similar to the grid of an ElevationGrid whereas the points do not have a uniform spacing. Depending on the weight-values and the order this hull is approximated by the resulting surface. uDimension points define a polyline in u-direction followed by further u-polylines with the v-parameter in ascending order. The number of control points must be equal or greater than the order. A closed B-Spline surface can be specified by repeating the limiting control points.
The control vertex corresponding to the control point P[i, j] on the control grid is :
P[i,j].x = controlPoints[i + (j * uDimension)].x
P[i,j].y = controlPoints[i + (j * uDimension)].y
P[i,j].z = controlPoints[i + (j * uDimension)].z
P[i,j].w = weight[ i + (j * uDimension)]
where 0 <= i < uDimension and 0 <= j < vDimension.
|

| |

 |
A weight value that must 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 closer approximated by the surface. The number of values must 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.
|

| |

 |
uKnots and vKnots define the knot vector. The number of knots must be equal to the number of control points plus the order of the curve. The order must be non-decreasing. By setting successive knot values equal the degree of continuity is decreased, which implies that the surface gets edges. If k is the order of the curve, k consecutive knots at the end or the beginning of the vector let converge the curve to the last or the first control point respectively. Within the knot vector there may be not 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.
|

| |

 |
uTessellation and vTessellation are ignored by Cortona (used for the compatibility with blaxxun Contact).
|

| |

 |
texCoord could provide additional information on how to generate texture coordinates.
By default, texture coordinates in the unit square are generated automatically from the parametric subdivision.
The texCoord field specifies per-vertex texture coordinates for the NurbsSurface node. If texCoord is not NULL, it shall specify a TextureCoordinate node containing (uDimension)x(vDimension) texture coordinates; one for each control point, ordered according to a set of control points. The texture coordinates for each point of the NURBS surface are calculated the same way as ordinary coordinates, but the array from TextureCoordinate is used instead of controlPoint.
|

| |

 |
ccw and solid are defined like in other VRML Geometry nodes. solid TRUE enables two-sided lighting, the surface is visible from both sides, and normals are flipped toward the viewer, prior to shading.
|

| |

 |
The distance and quality fields enable to control the quality of the NURBS surface breake down (triangulation) depending on the distance from the camera to the center of the object bounding box. The distance field specifies a set of distances to object. Each distance[i] value is correspond to the quality[i+1] value. The quality[0] value specifies the triangulation quality at distance=0. Thus, if the greatest index in the distance field is N, there shall be N+1 qualities in the quality field.
Let N denotes the greatest index in the distance field. The following equations define the current quality of the NURBS surface breake down:
D <= distance[0]:
Q = quality[0] + (quality[1] - quality[0]) * D / distance[0]
distance[i] < D <= distance[i+1]:
Q = quality[i+1] + (quality[i+2] - quality[i+1]) * (D - distance[i]) / (distance[i+1] - distance[i])
distance[N-1] < D:
Q = quality[N],
where:
D - the distance from the camera to the center of the object bounding box
Q - the current quality of the spline surface brake down, ranging from 0 for the worst quality to 1 for best surface.
|

|
|
|