X3D Scene Authoring Hints |
Authoring | Coordinate Systems | Credits | Dates | HTML | Images | Inlines/Prototypes | License | Meshes | meta Tags | Naming Conventions | Resources | Schema, DTD Validation | Scripts | URL Links | Viewpoints | X3D Resources
.x3db
) format
or putting Web3D examples into version control.
<meta name='created' content='1 October 2003'/>
<meta name='revised' content='15 May 2010'/>
10 July 2004
(rather than other forms such as
July 10, 2004
or
10/7/2004
).
HTML is the publishing language of the World Wide Web. HTML web pages can embedd or launch X3D scenes.
CoolImage.png
vice CoolImage.PNG)
.Inline
, image, audio and video content.
This approach is more maintainable, uses less memory and can reduce file-transfer delays.
IMPORT
/EXPORT
connections match.
Inline
tooltips
and
X3D specification
ProtoBody
.
ProtoDeclare
definitions into additional scenes,
instead copy ExternProtoDeclare
/ProtoInstance
definitions.
ProtoDeclare
,
ProtoInterface
and
ProtoBody
field
definitions in a ProtoInterface
element since that construct is illegal.
ExternProtoDeclare
/ProtoInstance
definitions
corresponding to each NewNodePrototype.x3d scene.
This encourages authors to avoid copying the ProtoDeclare
definitions,
so that a master version remains stable and improvable.
ProtoDeclare
annotation tooltips for each ExternProtoDeclare
field
.
ExternProtoDeclare
tooltips
and
X3D specification
containerField
attribute, identifying parent-node field name for this ProtoInstance
.
Default value: children
.
Example values: color
, coord
, geometry
, fontStyle
, proxy
, sound
, texture
, textureTransform
.
ProtoInstance
operation in the scene defining the original ProtoDeclare
, rather than
using an ExternProtoDeclare
.
Why - to make sure they work first!
Browser debugging can be more cryptic for externally defined prototypes
and different versions may occur in various remote url addresses, making it difficult to determine
precisely which ExternProtoDeclare
is being referenced.
ProtoInstance
tooltips
and
X3D specification
meta
tag
is included in archived X3D scenes:
<meta name="license" content="../../license.html">The license is available as license.html and also available in plain-text form as license.txt for embedding in source-code files. Under the terms of this BSD open-source license both commercial & noncommercial uses are permitted, and the contributing authors retain original copyright as appropriate. This license can be adapted for use by other open-source contributors, if desired. Discussion, rationale and references regarding this license are available via the XMSF bugtracker license entry.
meta
tags<meta name="description" value="This beautiful model of an actual clean bedroom will impress your mom."/>
<meta name="description" value="This description has a trailing newline character. "/>
<meta name="title"/>
(for document name)
and
<meta name="identifier"/>
(for document url)
tags, with filename values ending in .x3d
(rather than VRML97 .wrl) extension.
name="value"
attributes are defined by the
Dublin Core metadata terms.
meta
tag such as
<meta name="generator" content="X3D-Edit, https://savage.nps.edu/X3D-Edit"/>
META "generator" "X3D-Edit, https://savage.nps.edu/X3D-Edit"
Naming of multiple similar autogenerated files: Concatenate the following name components as appropriate. Separate components by period characters, since underscores disappear as part of a url and since hyphens will break across a line.
General notes on naming conventions:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "http://www.web3d.org/specifications/x3d-3.2.dtd"> <X3D profile="Immersive" version="3.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.2.xsd">There is no Transitional X3D 3.2 since it is no longer needed.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.1//EN" "http://www.web3d.org/specifications/x3d-3.1.dtd"> <X3D profile="Immersive" version="3.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.1.xsd">The Transitional X3D 3.1 DOCTYPE/DTD was used by some tools:
<?xml version="1.0" encoding="UTF-8"?> <!--Warning: transitional DOCTYPE in source .x3d file--> <!DOCTYPE X3D PUBLIC "http://www.web3d.org/specifications/x3d-3.1.dtd" "file:///www.web3d.org/TaskGroups/x3d/translation/x3d-3.1.dtd"> <X3D profile="Immersive" version="3.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.1.xsd">
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd"> <X3D profile="Immersive" version="3.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.0.xsd">The Transitional X3D 3.0 DOCTYPE/DTD was used by some tools:
<?xml version="1.0" encoding="UTF-8"?> <!--Warning: transitional DOCTYPE in source .x3d file--> <!DOCTYPE X3D PUBLIC "http://www.web3d.org/specifications/x3d-3.0.dtd" "file:///www.web3d.org/TaskGroups/x3d/translation/x3d-3.0.dtd"> <X3D profile="Immersive" version="3.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.0.xsd">When offline, X3D-Edit 3.1 can only load scenes containing the proper DTD one at a time. When disconnected from the network, click on a scene (or drag & drop the scene onto the X3D-Edit icon) to launch it - the DOCTYPE will be converted to Transitional DTD upon launch, and restored to Final DTD upon normal exit. Alternatively, use a different X3D/XML/text editor or the Transitional X3D DOCTYPE/DTD with X3D-Edit.
C:\www.web3d.org\x3d\content> java X3dDtdChecker usage: java X3dDtdChecker sceneName.x3d [-setFinalDTD | -setTransitionalDTD]
Developmental versions of all X3D DTDs and schemas are maintained under version control at http://x3d.svn.sourceforge.net/viewvc/x3d/www.web3d.org/specifications
var
declaration of variables.
Instead, declare any persistent variables as field definitions in the parent Script node.
<Script directOutput='true'>
when using SFNode/MFNode fields.
Browser.print(...)
rather than a simple print(...)
function
when printing to the console.
Browser.print(...)
is the form supported by X3D,
print(...)
was VRML97 syntax and is now obsolete.
For backwards compatibility, X3dToVrml97.xslt will strip
the preceding Browser.
class qualifier when converting scripts to VRLM97.
<
and >
from undesirable conversions by XML parsers.
Furthermore, it eliminates the need to use <
and >
escape-character replacements (which make script code nonportable).
Example:
<Script mustEvaluate="true"> <field name="message" type="SFString" accessType="initializeOnly" value="World!"/> <![CDATA[ ecmascript: function initialize (timestamp) { Browser.print ('Hello ' + message); } ]]> </Script>
ecmascript:
scripts, first add the following field interface to the Script.
<field accessType="initializeOnly" name="localTraceEnabled" type="SFBool" value="true"/>Then, at end of the CDATA section:
function tracePrint(outputString) { if (localTraceEnabled) Browser.print('[ScriptNameHere] ' + outputString); } function forcePrint(outputString) { Browser.print('[ScriptNameHere] ' + outputString); }This lets the script author use trace-aware output functions as a substitute for
Browser.print()
as follows.
tracePrint('Only print when localTraceEnabled is true'); forcePrint('Always print: localTraceEnabled=' + localTraceEnabled);
url
attribute values:
<ImageTexture url=' "earth-topo.png" "earth-topo-small.gif" "http://www.web3d.org/x3d/content/examples/earth-topo.png" "http://www.web3d.org/x3d/content/examples/earth-topo-small.gif" '/>or, if using the equivalent but more awkward syntax for "double-quoted"
url
attribute values:
<ImageTexture url=" "earth-topo.png" "earth-topo-small.gif" "http://www.web3d.org/x3d/content/examples/earth-topo.png" "http://www.web3d.org/x3d/content/examples/earth-topo-small.gif" "/>
url
has type MFString
.
url
tooltips
Updated: 7 August 2010
Maintained by
Don Brutzman
(brutzman at nps.edu).
Comments & suggestions are welcome.
Online at
http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html