X3D Model Documentation: ProtoTagDtdDeclarationExamples.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <!-- needed: add containerField, class attributes -->
  4  <!-- Instruction steps 1 through 4 are listed in detail within the DOCTYPE declaration internal subset. -->
  5  <!-- You must view full source of the DTD declarations (ProtoTagDtdDeclarationExamples.x3d.txt) to fully understand this file. -->
  6  <!-- ********************************************************************* -->
  7  <!-- ** Step 1: Copy the following DOCTYPE statement in your X3D scene. ** -->
  8  <!-- ** Ensure you include the square backet [ on line 32! ** -->
  9  <!-- ** Modify INCLUDE/IGNORE to match profiles of interest. ** -->
 10  <!-- ********************************************************************* -->
 11  <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'>
 12       <head>
 13            <meta name='titlecontent='ProtoTagDtdDeclarationExamples.x3d'/>
 14            <meta name='createdcontent='17 April 2000'/>
 15            <meta name='modifiedcontent='20 October 2019'/>
 16            <meta name='creatorcontent='Don Brutzman'/>
 17            <meta name='e-mailcontent='brutzman@nps.navy.mil'/>
 18            <meta name='descriptioncontent='Provides Prototype XML-tag-definition examples to demonstrate DTD modularization and extensibility in X3D scenes. Also see SpinGroupInternalSubsetDeclaration.x3d'/>
 19            <meta name=' warning content=' You must view full source of the DTD declarations (ProtoTagDtdDeclarationExamples.x3d.txt) to fully understand validation techniques in this file. '/>
 20            <meta name=' error content=' internal subset deficiency: nodeType attributes need to be converted to containerField attributes. '/>
 21            <meta name='referencecontent='ProtoTagDtdDeclarationExamples.x3d.txt'/>
 22            <meta name='referencecontent='SpinGroupInternalSubsetDeclaration.x3d.txt'/>
 23            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/development/ProtoTagDtdDeclarationExamples.x3d'/>
 24            <meta name='generatorcontent='X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html'/>
 25            <meta name='licensecontent='../license.html'/>
 26       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: FS, InitialTransform

Index for ProtoDeclare definition: NewTransformExample
-->
 27       <Scene>
 28            <!-- ********************************************************************* -->
 29            <!-- *** Step 5: Copy/edit ProtoDeclare, (optionally ProtoInstance) *** -->
 30            <!-- *** and the tagset version for your nodes of interest. *** -->
 31            <!-- *** When instantiating field Node/Nodes or field values, *** -->
 32            <!-- *** use fieldValue tags to override the initial values. *** -->
 33            <!-- *** The following example content instantiates prototype *** -->
 34            <!-- *** NewTransformExample using tags and ProtoInstance. *** -->
 35            <!-- ********************************************************************* -->
 36            <!-- Declaring the NewTransformExample PROTO: -->
 37            <ProtoDeclare name='NewTransformExample'>
 38                 <ProtoInterface>
 39                      <field name='translationtype='SFVec3fvalue='0 0 0accessType='inputOutput'/>
 40                      <field name='rotationtype='SFRotationvalue='0 0 1 0accessType='inputOutput'/>
 41                      <field name='centertype='SFVec3fvalue='0 0 0accessType='inputOutput'/>
 42                      <field name='scaletype='SFVec3fvalue='1 1 1accessType='inputOutput'/>
 43                      <field name='scaleOrientationtype='SFRotationvalue='0 0 1 0accessType='inputOutput'/>
 44                      <field name='bboxCentertype='SFVec3fvalue='0 0 0accessType='initializeOnly'/>
 45                      <field name='bboxSizetype='SFVec3fvalue='-1 -1 -1accessType='initializeOnly'/>
 46                      <field name='childrentype='MFNodeaccessType='inputOutput'>
 47                           <WorldInfo info='"overridden at run time"'/>
 48                      </field>
 49                 </ProtoInterface>
 50                 <ProtoBody>
 51                      <!-- Transform is first node, which determines node type, and encloses children for instances. -->
 52                      <Transform DEF='InitialTransform'>
 53                           <IS>
 54                                <connect nodeField='translationprotoField='translation'/>
 55                                <connect nodeField='rotationprotoField='rotation'/>
 56                                <connect nodeField='centerprotoField='center'/>
 57                                <connect nodeField='scaleprotoField='scale'/>
 58                                <connect nodeField='scaleOrientationprotoField='scaleOrientation'/>
 59                                <connect nodeField='bboxCenterprotoField='bboxCenter'/>
 60                                <connect nodeField='bboxSizeprotoField='bboxSize'/>
 61                                <connect nodeField='childrenprotoField='children'/>
 62                           </IS>
 63                      </Transform>
 64                 </ProtoBody>
 65            </ProtoDeclare>
 66            <!-- Instantiating the NewTransformExample PROTO using a ProtoInstance tag: -->
 67            <ProtoInstance name='NewTransformExample'>
 68                 <fieldValue name='translationvalue='0 1.5 0'/>
 69                 <fieldValue name='children'>
 70                      <Shape>
 71                           <Appearance>
 72                                <Material diffuseColor='0.1 0.8 0.8'/>
 73                           </Appearance>
 74                           <Text string='"ProtoTagDtdDeclaration Examples" "using a regular ProtoInstance"'>
 75 
                              <!-- FontStyle FS is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                              <FontStyle DEF='FSjustify='"MIDDLE" "MIDDLE"size='0.7'/>
 76                           </Text>
 77                      </Shape>
 78                 </fieldValue>
 79            </ProtoInstance>
 80            <!-- Instantiating the NewTransformExample node using a customized tag: -->
 81            <NewTransformExample center='0 0 0rotation='0 0 1 0scale='1 1 1scaleOrientation='0 0 1 0translation='0 -0.5 0'>
 82                 <fieldValue name='children'>
 83                      <Shape>
 84                           <Appearance>
 85                                <Material diffuseColor='0.1 0.8 0.2'/>
 86                           </Appearance>
 87                           <Text string='"plus header-declared XML tag from" "XML document subset declaration"'>
 88                                <FontStyle USE='FS'/>
 89                           </Text>
 90                      </Shape>
 91                 </fieldValue>
 92            </NewTransformExample>
 93            <Transform translation='0 -2 0'>
 94                 <Anchor description='Click to view source (ProtoTagDtdDeclarationExamples.x3d.txt)parameter='"target=_blank"'   url=' "ProtoTagDtdDeclarationExamples.x3d.txt" "https://www.web3d.org/x3d/content/examples/development/ProtoTagDtdDeclarationExamples.x3d.txt" '>
 95                      <Shape>
 96                           <Appearance>
 97                                <Material diffuseColor='0.8 0.4 0.1'/>
 98                           </Appearance>
 99                           <Text string='"(click to see source)"'>
100                                <FontStyle USE='FS'/>
101                           </Text>
102                      </Shape>
103                 </Anchor>
104            </Transform>
105       </Scene>
106  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: FS, InitialTransform

Index for ProtoDeclare definition: NewTransformExample
-->
X3D Tooltips element index: Anchor, Appearance, connect, field, fieldValue, FontStyle, head, IS, Material, meta, NewTransformExample, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, Scene, Shape, Text, Transform, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table with 0 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.


ProtoInstance
NewTransformExample
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declaration with
direct access to other nodes, and thus has potential to produce run-time animation. 


Anchor
description='Click to view source (ProtoTagDtdDeclarationExamples.x3d.txt)' 
User-interaction hint for this node. 
Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with 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> -->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->