ParallelGraphics
Home  »  Developer Zone  »  Products  »  Cortona VRML Client for Mac OS X  »  VRML Extensions  »  Splines
Up to VRML Extensions

AdvancedAppearance 

Splines 

Nurbs 

Keyboard Input 

SFVec2f Interpolator 

Drag & Drop Handling 


Subscribe to Newsletter
 


Google Searchsite search:

 

%(domain)s %(domain)s
Install Cortona VRML Client!

Outline 3D

Try RobinZone!


Splines
Cortona spline technology
Scene size: 946bytes
ParallelGraphics developed spline representation of geometry objects. Typically, by using VRML97 file format, the faces are used to build curvy shapes. There are two choices to avoid faceted shading: use many more faces to approximate the smooth shape, or shade the faces differently so it looks like you used lots of faces (Gouraud method). However, the spline objects are geometrically smooth and allow to transform them to any required quantity of faces to display.


The key benefits from the use of spline objects include:

     
    The high quality of a smooth surface can be described using VRML.
     
    It is required less computing resources for achievement of high quality.
     
    The size of the VRML-file decreases essentially (up to 10 times) without degradation of surface quality.
     
    The smooth variation of input parameters results in transformation of the spline surface that is worth to simplify the creation of realistic animations.
     
    The dynamic detailed elaboration provides the balance between necessary quality and frame-rate.
     
    The function of quality allows to operate a degree of detailed elaboration of a surface.
ParallelGraphics offers six new nodes: based on the standard nodes and expressed in using the VRML prototyping mechanism (external prototypes). Each new node contains both the same fields standard VRML node includes and extensions controlling level of detailed elaboration of a surface. ParallelGraphics' Cortona VRML client supports the proposed nodes and uses the spline representation for objects. The simplest way to use spline nodes is that of changing the appropriate node name. Other browsers interprets these nodes as Cone, Cylinder, ElevationGrid, Extrusion, FaceSet, and Sphere.

The method of spline representation of geometry objects is based on three-cubic spline interpolation, which is performed with Cortona VRML client automatically using incoming polygonal data (control vertices). So a spline surface includes all control vertices of the polygonal model. While rendering, a surface is broken down (tessellated) into a set of triangles approximating the spline surface. To balance between quality and the frame-rate, a surface curvature and number of triangles are taken into account. Moreover, it's possible to control the tessellation using the quality function.

ParallelGraphics has also developed the suitable converter for the translation of standard polygonal objects to the spline analogies.



Geometric spline nodes
Each node corresponds to standard VRML node except the fields distance and quality. All other field definitions are similar to the VRML97 Node Reference. This section provides a detailed definition of the syntax of proposed nodes.

SplineCone {
  field	SFFloat	bottomRadius 1
  field	SFFloat	height       2
  field	SFBool	side         TRUE
  field	SFBool	bottom       TRUE
  field	MFFloat	distance     10
  field	MFFloat	quality      [0, 0.75]
}


SplineCylinder {
  field		SFBool	bottom	TRUE
  field		SFFloat	height	2
  field		SFFloat	radius	1
  field		SFBool	side	TRUE
  field		SFBool	top	TRUE
  exposedField	MFFloat	distance 10
  exposedField	MFFloat	quality  [0, 0.75]
}


SplineElevationGrid {
  eventIn		MFFloat	set_height
  exposedField	SFNode	color		NULL
  exposedField	SFNode	normal		NULL
  exposedField	SFNode	texCoord		NULL
  field		MFFloat	height		[]
  field		SFBool	ccw		TRUE
  field		SFBool	colorPerVertex	TRUE
  field		SFFloat	creaseAngle	0
  field		SFBool	normalPerVertex	TRUE
  field		SFBool	solid		TRUE
  field		SFInt32	xDimension	0
  field		SFFloat	xSpacing		0.0
  field		SFInt32	zDimension	0
  field		SFFloat	zSpacing		0.0
  exposedField	MFFloat	distance		10
  exposedField	MFFloat	quality		[0, 0.75]
}


SplineExtrusion {
  eventIn		MFVec2f		set_crossSection
  eventIn		MFRotation	set_orientation
  eventIn		MFVec2f		set_scale
  eventIn		MFVec3f		set_spine
  field		SFBool		beginCap		TRUE
  field		SFBool		ccw		TRUE
  field		SFBool		convex		TRUE
  field		SFFloat		creaseAngle	0
  field		MFVec2f		crossSection	[1 1,
						 1 -1,
						 -1 -1,
						 -1 1,
						 1 1]
  field		SFBool		endCap		TRUE
  field		MFRotation	orientation	0 0 1 0
  field		MFVec2f		scale		1 1
  field		SFBool		solid		TRUE
  field		MFVec3f		spine		[0 0 0,
                                 	 		 0 1 0]
  field		MFFloat		distance		10
  field		MFFloat		quality		[0, 0.75]
}


SplineFaceSet {
  eventIn		MFInt32	set_colorIndex
  eventIn		MFInt32	set_coordIndex
  eventIn		MFInt32	set_normalIndex
  eventIn		MFInt32	set_texCoordIndex
  exposedField	SFNode	color		NULL
  exposedField	SFNode	coord		NULL
  exposedField	SFNode	normal		NULL
  exposedField	SFNode	texCoord		NULL
  field		SFBool	ccw               TRUE
  field		MFInt32	colorIndex        []
  field		SFBool	colorPerVertex    TRUE
  field		SFBool	convex            TRUE
  field		MFInt32	coordIndex        []
  field		SFFloat	creaseAngle       0
  field		MFInt32	normalIndex       []
  field		SFBool	normalPerVertex   TRUE
  field		SFBool	solid             TRUE
  field		MFInt32	texCoordIndex     []
  exposedField	MFFloat	distance		10
  exposedField	MFFloat	quality		[0, 0.75]
}


SplineSphere {
  field		SFFloat	radius    1
  exposedField	MFFloat	distance  10
  exposedField	MFFloat	quality   [0, 0.75]
}


The smoothing surfaces is available only if the field normalPerVertex is set to TRUE (default value) that is correspond to Gouraud method for polygonal objects. If a set of 3D surface normal vectors is defind in node(the normal field), Cortona will use it in generating of a spline surface. If the normal field is NULL, the browser treats the normals automatically generated, using the creaseAngle field (see VRML97, Node Reference). The resulted spline surface contains all of vertices defined in node, and normals per vertex coincide with normals per spline surface at vertices.

The distance and quality fields enable to control the quality of the spline surface brake 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 spline surface brake 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.




Last updated: Tue, 07 Oct 2008
© 2000-2008 ParallelGraphics. All rights reserved. Terms of use.