ccFactory        

the component class Factory

       

x3dSnap compiler user guide

the user guide provides detailed information about the command line syntax and current VRML support level

Command line argument summary

The x3dSnap compiler translates VRML97 world definitions (source) into the ANSI C programming language syntax (target) using the following syntax:

cxc [switch] [input.wrl] [output.c]

The [switch] and [output.c] parameters are optional. Here are a few examples

cxc xyz.wrl

Compiles the source file xyz.wrl . If no errors occur, the target file xyz.c will be created in the same directory

cxc +t vrml_export.wrl model.c

This example compiles the vrml_export.wrl source file with the texture redirect option enabled. The output is stored in model.c

 

Compiler switches

Switches can be used to change the behavior of the compiler.  To enable a switch, use the '+' operator, otherwise '-' will disable the switch. The syntax is:

cxc +o world.wrl target.c (enable option 'o')
cxc -o world.wrl target.c (disable option 'o')

Below is a summary of the current compiler switches for the standard version

Table 1.0 -- Compiler switch Quick Reference
Switch Comments

a

Use client vertex arrays

This option instructs the compiler to render geometry using client vertex arrays. Geometry nodes such as IndexedFaceSet, ElevationGrid and Box can be rendered very efficiently using this feature of the GL API. Vertex, texture, normal and color information is consolidated into one global array and reused for the entire scene graph. This option can dramatically reduce the size of the compiled world, as well as (depending on the hardware) increase rendering performace.

cxc +a world.wrl

enables vertex array support. This feature is switched 'on' by default

t

Direct texture data into a separate file

Texture data can quickly bloat the source code file into unmanageable sizes.  Since texture data is inherently static, it can be useful to have this information separated from other parts of the world definition that change more frequently.

cxc +t world.wrl

produces two files, world.c and world_textures.c. The name of the separate texture file is always [target]_textures.c. Be sure to include both files when building the executable

g[n]

Set detail level for quadric geometry

Spheres, Cones and Cylinders are rendered via OpenGL's quadric utility functions.  This value is used to determine how many slices and stacks should be used when rendering these geometries.

x3dsnap +g20 world.wrl

Default level is 10

v

Display compiler version number

Useful for support purposes

x3dsnap +v

e,w,m

Display/Suppress compiler errors, warnings or messages

During compilation, the compiler writes diagnostic information to the console in the form of errors, warnings and messages. Most errors are parsing errors caught by the compiler before the first pass of code generation begins.  If one or more compiler errors occur, the process aborts and the line number with the offending syntax is given. After parsing successfully, a scene graph data structure of the world is built internally and the first pass can begin.  The compiler "walks" the scene graph, generating code determined by the nodes encountered.  Compiler warnings are generated when a non-fatal problem is found during one of these phases. Typical warnings can include illegal polygon declarations (polygons with less than 3 vertices), resource loading errors and view frustum size limitations. Throughout the compile process, messages are fed back to the console reporting on the progress of the translation. Use the e, w, and m switches to control which diagnostic information is to be displayed or filtered 

x3dsnap +e world.wrl display compiler errors (on by default)
x3dsnap -e world.wrl suppress compiler errors

x3dsnap +w world.wrl display compiler warnings (on by default)
x3dsnap -w world.wrl suppress compiler warnings

x3dsnap +m world.wrl display compiler messages (on by default)
x3dsnap -m world.wrl suppress compiler messages

 

Level of VRML97 Support

The current version of the x3dSnap compiler supports a large subset of the VRML97 node set.  Not all VRML nodes however,  lend themselves to be statically compiled.  This is especially true for nodes tightly bound to the VRML event model.

For a comprehensive definition of the ISO Virtual Reality Modeling Language, visit the Web 3D consortium web site. 

Table 1.1 -- VRML97 Node Support

Component Node Support Level Notes
Geometry Box full  
Cone full  
Cylinder full  
ElevationGrid 90% completed creaseAngle field ignored
Extrusion none deferred
IndexedFaceSet full  
IndexedLineSet full  
PointSet full  
Shape full  
Sphere full  
Text none deferred
Appearance Appearance full  
Material full  
ImageTexture 75% completed Windows BMP, JPG format supported. PNG, GIF deferred
PixelTexture full  
MovieTexture none not planned
Bindable Nodes Background none deferred
Fog none deferred
NavigationInfo full  
Viewpoint full  
Lighting DirectionalLight full  
PointLight 90% completed radius field ignored
SpotLight 90% completed radius field ignored
Grouping Anchor partial only children are honored
Billboard partial only children are honored
Collision partial only children are honored
Group full  
Inline full  
LOD partial first child is always chosen
Switch full  
Transform full  
Interpolators ColorInterpolator none deferred
CoordinateInterpolator none deferred
NormalInterpolator none deferred
OrientationInterpolator none deferred
PositionInterpolator none deferred
ScalarInterpolator none deferred
Sensors CylinderSensor none deferred
PlaneSensor none deferred
ProximitySensor none deferred
SphereSensor none deferred

Table 1.2 -- VRML97 Language Support

Component Keyword Support Level Notes
Instancing DEF/USE full The DEF/USE mechanism is important for sharing similar state within the VRML file.  Reused nodes are packaged as functions during compilation.  Only nodes that are 'reused', however,  are transformed into subroutines.
Prototyping PROTO full  
EXTERNPROTO none deferred.  External Prototypes are not supported in this version. Warning: compiler reports an error when an EXTERNPROTO is encountered.
Scripting Script none deferred. Pass-through for ANSI C code planned for next version.
Events ROUTE none deferred. Route statements are parsed and ignored during compilation.
       

mailto:info@ccfactory.com

Productivity through component-oriented software development