X3D Model Documentation: LODlevelChangedExample.x3d go to online X3D Example Archives model page

  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='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='title' content=' LODlevelChangedExample.x3d '/>
  6            <meta name='description' content='Example use of (proposed) LOD level_changed outputOnly field to trigger loading of Inline nodes in subsequent levels.'/>
  7            <meta name='creator' content='Don Brutzman'/>
  8            <meta name='motivation' content='Chris Thorne'/>
  9            <meta name='created' content='26 May 2004'/>
 10            <meta name='modified' content='20 October 2019'/>
 11            <meta name=' warning ' content=' under development, evaluating a proposed specification change '/>
 12            <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Basic/development/LODlevelChangedExample.x3d '/>
 13            <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 14            <meta name='license' content='../license.html'/>
 15       </head>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: 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='activeLOD' range='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='InlineLevel1' load='false'/>
 25 
               <!-- ROUTE information for InlineLevel2 node:  [from PreloadLevelsScript.activateLevel2 to load ] -->
               <Inline DEF='InlineLevel2' load='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_changed' type='SFInt32' accessType='inputOnly'/>
 31                      <field name='activateLevel1' type='SFBool' accessType='outputOnly'/>
 32                      <field name='activateLevel2' type='SFBool' accessType='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 0' position='0 0 4'/>
 41                 <Viewpoint description='level 1' position='0 0 8'/>
 42                 <Viewpoint description='level 2' position='0 0 12'/>
 43            </Group>
 44       </Scene>
 45  </X3D>
<!--

Event Graph ROUTE Table shows event connections.

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

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, Viewpoint_3

-->

X3D Tooltips element index: to top field, FontStyle, Group, head, Inline, LOD, meta, ROUTE, Scene, Script, Shape, Text, Viewpoint, WorldInfo, X3D,
plus documentation for accessType definitions, type definitions, XML data types, and field types

🔖   Event Graph ROUTE Table entries with 3 ROUTE connections, showing X3D event-model relationships for this scene.

Each row with a ROUTE statement shows an event cascade that may occur during a single timestamp interval between frame renderings, performed 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! 😀

-->
go to online X3D Example Archives model page <!-- Online at
https://www.web3d.org/x3d/content/examples/Basic/development/LODlevelChangedExampleIndex.html -->
<!-- SourceForge version control Version control at    
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/LODlevelChangedExample.x3d -->

<!-- Color-coding 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. -->