<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<!-- needed: add containerField, class attributes -->
<!-- Instruction steps 1 through 4 are listed in detail within the DOCTYPE declaration internal subset. -->
<!-- You must view full source of the DTD declarations (ProtoTagDtdDeclarationExamples.x3d.txt) to fully understand this file. -->
<!-- ********************************************************************* -->
<!-- ** Step 1: Copy the following DOCTYPE statement in your X3D scene. ** -->
<!-- ** Ensure you include the square backet [ on line 32! ** -->
<!-- ** Modify INCLUDE/IGNORE to match profiles of interest. ** -->
<!-- ********************************************************************* -->
<X3D profile='Immersive'
version='3.0'
xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'
xsd:noNamespaceSchemaLocation
='
https://www.web3d.org/specifications/x3d-3.0.xsd
'
>
<head>
</head>
<!--
-->
<Scene>
<!-- ********************************************************************* -->
<!-- *** Step 5: Copy/edit ProtoDeclare, (optionally ProtoInstance) *** -->
<!-- *** and the tagset version for your nodes of interest. *** -->
<!-- *** When instantiating field Node/Nodes or field values, *** -->
<!-- *** use fieldValue tags to override the initial values. *** -->
<!-- *** The following example content instantiates prototype *** -->
<!-- *** NewTransformExample using tags and ProtoInstance. *** -->
<!-- ********************************************************************* -->
<!-- Declaring the NewTransformExample PROTO: -->
<ProtoDeclare name='NewTransformExample'>
<ProtoInterface>
<field name='translation' type='SFVec3f' value='0 0 0' accessType='inputOutput'/>
<field name='rotation' type='SFRotation' value='0 0 1 0' accessType='inputOutput'/>
<field name='center' type='SFVec3f' value='0 0 0' accessType='inputOutput'/>
<field name='scale' type='SFVec3f' value='1 1 1' accessType='inputOutput'/>
<field name='scaleOrientation' type='SFRotation' value='0 0 1 0' accessType='inputOutput'/>
<field name='bboxCenter' type='SFVec3f' value='0 0 0' accessType='initializeOnly'/>
<field name='bboxSize' type='SFVec3f' value='-1 -1 -1' accessType='initializeOnly'/>
<field name='children' type='MFNode' accessType='inputOutput'>
<WorldInfo info='"overridden at run time"'/>
</field>
</ProtoInterface>
<ProtoBody>
<!-- Transform is first node, which determines node type, and encloses children for instances. -->
<Transform DEF='InitialTransform'>
<IS>
<connect nodeField='translation' protoField='translation'/>
<connect nodeField='rotation' protoField='rotation'/>
<connect nodeField='center' protoField='center'/>
<connect nodeField='scale' protoField='scale'/>
<connect nodeField='scaleOrientation' protoField='scaleOrientation'/>
<connect nodeField='bboxCenter' protoField='bboxCenter'/>
<connect nodeField='bboxSize' protoField='bboxSize'/>
<connect nodeField='children' protoField='children'/>
</IS>
</Transform>
</ProtoBody>
</ProtoDeclare>
<!-- Instantiating the NewTransformExample PROTO using a ProtoInstance tag: -->
<ProtoInstance name='NewTransformExample'>
<fieldValue name='translation' value='0 1.5 0'/>
<fieldValue name='children'>
<Shape>
<Appearance>
<Material diffuseColor='0.1 0.8 0.8'/>
</Appearance>
<Text string='"ProtoTagDtdDeclaration Examples" "using a regular ProtoInstance"'>
<FontStyle DEF='FS' justify='"MIDDLE" "MIDDLE"' size='0.7'/>
</Text>
</Shape>
</fieldValue>
</ProtoInstance>
<!-- Instantiating the NewTransformExample node using a customized tag: -->
<
NewTransformExample center='
0 0 0'
rotation='
0 0 1 0'
scale='
1 1 1'
scaleOrientation='
0 0 1 0'
translation='
0 -0.5 0'>
<fieldValue name='children'>
<Shape>
<Appearance>
<Material diffuseColor='0.1 0.8 0.2'/>
</Appearance>
<Text string='"plus header-declared XML tag from" "XML document subset declaration"'>
</Text>
</Shape>
</fieldValue>
</
NewTransformExample>
<Transform translation='0 -2 0'>
</Transform>
</Scene>
</X3D>
<!--
-->
-->
<!--
Online at
https://www.web3d.org/x3d/content/examples/Basic/development/ProtoTagDtdDeclarationExamplesIndex.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/ProtoTagDtdDeclarationExamples.x3d
-->
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->