X3D Best Practices
This is the initial attempt to define "Best Practices" for creating X3D scenes, especially for handling X3DOM (X3D V4).
An important starting point is the X3D Scene Authoring Hints page developed by Don.
The goal with this page is to help someone starting out to make the best choices in developing a scene to be displayed in a browser. It is meant as entry-level document and needs to have lots of images and coding examples (but probably not all in one document).
This is the initial list of topics that need to be addressed. Some of these may be more specific to X3DOM and may be best as a "side-bar" document.
- HTML structure
- External libraries (JS and CSS)
- X3DOM code in HTML
- Reference to external files
- Cross-site scripting limitations
- URLs
- Multiple URLs
- Nodes to use / not use
- DEF vs. ID
- Javascript interface
- Content authoring tools (a more focused list than the one at http://www.web3d.org/x3d/content/examples/X3dResources.html#AuthoringSof...)
- For exporting X3D files, from authoring application or conversion utility
- Ensure that DEF values are unique, do not start with a number, do not use whitespace or special characters.
- Define useful "description" fields for all defined viewpoints
- Define at least one viewpoint that will show the user a meaningful "view all" display
- Do not use spaces or special characters in file and folder names
- provide relative paths, which allows retrieval from a local server, in the MFURL paths for ImageTexture Inline, AudioClip and MovieTexture nodes. An additional absolute URL from a remote server may also be provided as backup.
- Provide a file-level UNIT statement , to allow for combining models while maintaining proper size relation
- Give authors the option at export time to specify the value of the 'solid' field for each shape that has this field.
- Export geometry using simple shapes (Box, Sphere, Cone, Cylinder). Remember that using a Transform node with directional scale will allow any rectangular prism to be rendered with Box, and any ellipsoid to be rendered with Sphere.
- LineSet and PointSet shapes should have color specified in the emissiveColor field of a Material node.