![]() |
X3D Scene Authoring Hints |
![]() |
Authoring | Coordinate Systems | Credits | Dates | Help | HTML | Images | Inlines/Prototypes | License | meta Tags | Naming Conventions | Scripts | URL Links | Viewpoints
<?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 is 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 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.
<?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 is 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">
C:\www.web3d.org\x3d\content> java X3dDtdChecker usage: java X3dDtdChecker sceneName.x3d [-setFinalDTD | -setTransitionalDTD]
<meta name='created' content='18 October 2003'/>
<meta name='revised' content='19 October 2004'/>
10 July 2004
(rather than other forms such as
July 10, 2004
or
10/7/2004
).
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="filename"/>
and
<meta name="url"/>
tags, with filename values ending in .x3d
(rather than .wrl).
meta
tag such as
<meta name="generator" content="X3D-Edit, http://www.web3d.org/x3d/content/README.X3D-Edit.html"/>
META "generator" "X3D-Edit, http://www.web3d.org/x3d/content/README.X3D-Edit.html"
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:
<Script directOutput='true'>
when using SFNode/MFNode fields.
Browser.print(...)
rather than a simple print(...)
function
when printing to the console. 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
has type MFString
.
<ImageTexture url=' "earth-topo.png" "earth-topo-small.gif" "file:///c:/www.web3d.org/x3d/content/examples/earth-topo.png" "file:///c:/www.web3d.org/x3d/content/examples/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" ' />
<ImageTexture url=""earth-topo.png" "earth-topo-small.gif""/>
Updated: 14 April 2007
Maintained by
Don Brutzman
(brutzman at nps.edu).
Comments & suggestions are welcome.
Online at
http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html