X3D Model Documentation: LODlevelChangedExample.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  <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'>
  4       <head>
  5            <meta name='titlecontent='LODlevelChangedExample.x3d'/>
  6            <meta name='descriptioncontent='Example use of (proposed) LOD level_changed outputOnly field to trigger loading of Inline nodes in subsequent levels.'/>
  7            <meta name='creatorcontent='Don Brutzman'/>
  8            <meta name='motivationcontent='Chris Thorne'/>
  9            <meta name='createdcontent='26 May 2004'/>
 10            <meta name='modifiedcontent='20 October 2019'/>
 11            <meta name=' warning content=' under development, evaluating a proposed specification change '/>
 12            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/development/LODlevelChangedExample.x3d'/>
 13            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 14            <meta name='licensecontent='../license.html'/>
 15       </head>
<!--

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

<!-- to top Index for DEF nodes: activeLOD, InlineLevel1, InlineLevel2, PreloadActivationGroup, PreloadLevelsScript, ShapeLevel0, ViewpointGroup

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, Viewpoint_3
-->
 16       <Scene>
 17            <WorldInfo title='LODlevelChangedExample.x3d'/>
 18 
          <!-- ROUTE information for activeLOD node:  [from level_changed to PreloadLevelsScript.level_changed ] -->
          <LOD DEF='activeLODrange='6 10'>
 19                 <Shape DEF='ShapeLevel0'>
 20                      <Text string='"developmental test scene" "LODlevelChangedExample"'>
 21                           <FontStyle justify='"MIDDLE" "MIDDLE"'/>
 22                      </Text>
 23                 </Shape>
 24 
               <!-- ROUTE information for InlineLevel1 node:  [from PreloadLevelsScript.activateLevel1 to load ] -->
               <Inline DEF='InlineLevel1load='false'/>
 25 
               <!-- ROUTE information for InlineLevel2 node:  [from PreloadLevelsScript.activateLevel2 to load ] -->
               <Inline DEF='InlineLevel2load='false'/>
 26                 <!-- etc. -->
 27            </LOD>
 28            <Group DEF='PreloadActivationGroup'>
 29 
               <!-- ROUTE information for PreloadLevelsScript node:  [from activeLOD.level_changed to level_changed ] [from activateLevel1 to InlineLevel1.load ] [from activateLevel2 to InlineLevel2.load ] -->
               <Script DEF='PreloadLevelsScript'>
 30                      <field name='level_changedtype='SFInt32accessType='inputOnly'/>
 31                      <field name='activateLevel1type='SFBoolaccessType='outputOnly'/>
 32                      <field name='activateLevel2type='SFBoolaccessType='outputOnly'/>
  <![CDATA[
        
ecmascript:

function level_changed (value, timestamp)
{
	Browser.println ('level=' + value);
	if      (value == 1) activateLevel1 = true;
	else if (value == 2) activateLevel2 = true;
	// etc.
}

      
]]>
 34                 </Script>
 35                 < ROUTE  fromNode='activeLOD' fromField='level_changed' toNode='PreloadLevelsScript' toField='level_changed'/>
 36                 < ROUTE  fromNode='PreloadLevelsScript' fromField='activateLevel1' toNode='InlineLevel1' toField='load'/>
 37                 < ROUTE  fromNode='PreloadLevelsScript' fromField='activateLevel2' toNode='InlineLevel2' toField='load'/>
 38            </Group>
 39            <Group DEF='ViewpointGroup'>
 40                 <Viewpoint description='level 0position='0 0 4'/>
 41                 <Viewpoint description='level 1position='0 0 8'/>
 42                 <Viewpoint description='level 2position='0 0 12'/>
 43            </Group>
 44       </Scene>
 45  </X3D>
<!--

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

<!-- to top Index for DEF nodes: activeLOD, InlineLevel1, InlineLevel2, PreloadActivationGroup, PreloadLevelsScript, ShapeLevel0, ViewpointGroup

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, Viewpoint_3
-->
X3D Tooltips element index: field, FontStyle, Group, head, Inline, LOD, meta, ROUTE, Scene, Script, Shape, Text, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table with 3 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.

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/LODlevelChangedExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/LODlevelChangedExample.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)
-->

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