<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.3.xsd '>
<head>
<meta name='titlecontent='ViewFrustumPrototype.x3d'/>
<meta name='descriptioncontent='Define a view frustum associated with a given pair of Viewpoint and NavigationInfo nodes, provided as a reusable prototype.'/>
<meta name='creatorcontent='Don Brutzman'/>
<meta name='translatedcontent='16 August 2008'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent='ViewFrustumExample.x3d'/>
<meta name='drawingcontent='ViewFrustumComputation.png'/>
<meta name='Imagecontent='ViewFrustumOverheadView.png'/>
<meta name='Imagecontent='ViewFrustumObliqueView.png'/>
<meta name='subjectcontent='view culling frustum'/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<WorldInfo title='ViewFrustumPrototype.x3d'/>
<ProtoDeclare name='ViewFrustumappinfo='Display view frustum associated with a given pair of Viewpoint NavigationInfo nodes'>
<ProtoInterface>
<field name='ViewpointNodetype='SFNodeaccessType='initializeOnly'
 appinfo='required: insert Viewpoint DEF or USE node for view of interest'>
<!-- NULL node, ProtoInstance must provide -->
</field>
<field name='NavigationInfoNodetype='SFNodeaccessType='initializeOnly'
 appinfo='required: insert NavigationInfo DEF or USE node of interest'>
<!-- NULL node, ProtoInstance must provide -->
</field>
<field name='visibletype='SFBoolvalue='trueaccessType='inputOutput'
 appinfo='whether or not frustum geometry is rendered'/>

<field name='lineColortype='SFColorvalue='0.9 0.9 0.9accessType='inputOutput'
 appinfo='RGB color of ViewFrustum outline, default value 0.9 0.9 0.9'/>

<field name='frustumColortype='SFColorvalue='0.8 0.8 0.8accessType='inputOutput'
 appinfo='RGB color of ViewFrustum hull geometry, default value 0.8 0.8 0.8'/>

<field name='transparencytype='SFFloatvalue='0.5accessType='inputOutput'
 appinfo='transparency of ViewFrustum hull geometry, default value 0.5'/>

<field name='aspectRatiotype='SFFloatvalue='0.75accessType='inputOutput'
 appinfo='assumed ratio height/width, default value 0.75'/>

<field name='tracetype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='debug support, default false'/>
</ProtoInterface>
<ProtoBody>
<!-- ROUTE information for VisibilitySwitch node:  [from GeometryComputationScript.visibilitySwitchSelection to whichChoice ] -->
<Switch DEF='VisibilitySwitchwhichChoice='-1'>
<!-- ROUTE information for PositionTransform node:  [from GeometryComputationScript.position_changed to translation ] -->
<Transform DEF='PositionTransformrotation='0 1 0 3.14159'>
<!-- ROUTE information for OrientationTransform node:  [from GeometryComputationScript.orientation_changed to rotation ] -->
<Transform DEF='OrientationTransform'>
<Shape>
<IndexedLineSet DEF='FrustumLinescoordIndex='0 1 2 3 0 -1 4 5 6 7 4 -1 0 4 -1 1 5 -1 2 6 -1 3 7 -1'>
<!-- ROUTE information for FrustumCoordinate node:  [from GeometryComputationScript.point_changed to point ] -->
<Coordinate DEF='FrustumCoordinatepoint='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'/>
</IndexedLineSet>
<Appearance>
<Material>
<IS>
<connect nodeField='emissiveColorprotoField='lineColor'/>
</IS>
</Material>
</Appearance>
</Shape>
<Shape>
<!-- ROUTE information for FrustumExtrusion node:  [from GeometryComputationScript.spine_changed to set_spine ] [from GeometryComputationScript.scale_changed to set_scale ] -->
<Extrusion DEF='FrustumExtrusion'/>
<Appearance DEF='FrustumAppearance'>
<Material>
<IS>
<connect nodeField='diffuseColorprotoField='frustumColor'/>
<connect nodeField='transparencyprotoField='transparency'/>
</IS>
</Material>
</Appearance>
</Shape>
<Shape>
<Sphere radius='0.08'/>
<Appearance USE='FrustumAppearance'/>
</Shape>
</Transform>
</Transform>
</Switch>
<!-- ROUTE information for GeometryComputationScript node:  [from visibilitySwitchSelection to VisibilitySwitch.whichChoice ] [from position_changed to PositionTransform.translation ] [from orientation_changed to OrientationTransform.rotation ] [from spine_changed to FrustumExtrusion.set_spine ] [from scale_changed to FrustumExtrusion.set_scale ] [from point_changed to FrustumCoordinate.point ] -->
<Script DEF='GeometryComputationScriptdirectOutput='true'
  url=' "ViewFrustumPrototypeScript.js" "https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototypeScript.js" '>
<field name='visibletype='SFBoolaccessType='inputOutput'
 appinfo='Whether or not frustum geometry is rendered'/>

<field name='visibilitySwitchSelectiontype='SFInt32accessType='outputOnly'
 appinfo='Adjust Switch selection to make geometry visible or not'/>

<field name='ViewpointNodetype='SFNodeaccessType='initializeOnly'>
<!-- initialization node (if any) goes here -->
</field>
<field name='NavigationInfoNodetype='SFNodeaccessType='initializeOnly'>
<!-- initialization node (if any) goes here -->
</field>
<field name='FrustumCoordinatetype='SFNodeaccessType='initializeOnly'>
<Coordinate USE='FrustumCoordinate'/>
</field>
<field name='FrustumExtrusiontype='SFNodeaccessType='initializeOnly'>
<Extrusion USE='FrustumExtrusion'/>
</field>
<field name='recomputetype='SFBoolaccessType='inputOnly'/>
<field name='aspectRatiotype='SFFloataccessType='inputOutput'
 appinfo='assumed ratio height/width'/>

<field name='position_changedtype='SFVec3faccessType='outputOnly'/>
<field name='orientation_changedtype='SFRotationaccessType='outputOnly'/>
<field name='spine_changedtype='MFVec3faccessType='outputOnly'/>
<field name='scale_changedtype='MFVec2faccessType='outputOnly'/>
<field name='point_changedtype='MFVec3faccessType='outputOnly'/>
<field name='tracetype='SFBoolaccessType='initializeOnly'/>
<IS>
<connect nodeField='visibleprotoField='visible'/>
<connect nodeField='ViewpointNodeprotoField='ViewpointNode'/>
<connect nodeField='NavigationInfoNodeprotoField='NavigationInfoNode'/>
<connect nodeField='aspectRatioprotoField='aspectRatio'/>
<connect nodeField='traceprotoField='trace'/>
</IS>
</Script>
<ROUTE fromNode='GeometryComputationScriptfromField='visibilitySwitchSelectiontoNode='VisibilitySwitchtoField='whichChoice'/>
<ROUTE fromNode='GeometryComputationScriptfromField='position_changedtoNode='PositionTransformtoField='translation'/>
<ROUTE fromNode='GeometryComputationScriptfromField='orientation_changedtoNode='OrientationTransformtoField='rotation'/>
<ROUTE fromNode='GeometryComputationScriptfromField='spine_changedtoNode='FrustumExtrusiontoField='set_spine'/>
<ROUTE fromNode='GeometryComputationScriptfromField='scale_changedtoNode='FrustumExtrusiontoField='set_scale'/>
<ROUTE fromNode='GeometryComputationScriptfromField='point_changedtoNode='FrustumCoordinatetoField='point'/>
</ProtoBody>
</ProtoDeclare>
<!-- Example use is in separate scene -->
<Anchor description='ViewFrustum Example'
  url=' "ViewFrustumExample.x3d" "https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumExample.x3d" "ViewFrustumExample.wrl" "https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumExample.wrl" '>
<Shape>
<Appearance>
<Material diffuseColor='0.8 0.4 0'/>
</Appearance>
<Text string='"ViewFrustumPrototype.x3d" "is a Prototype declaration file." "For an example scene using the prototype," "click this text and view" "ViewFrustumExample.x3d"'>
<FontStyle justify='"MIDDLE" "MIDDLE"size='0.8'/>
</Text>
</Shape>
</Anchor>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : ViewFrustum

Index for DEF nodes : FrustumAppearance, FrustumCoordinate, FrustumExtrusion, FrustumLines, GeometryComputationScript, OrientationTransform, PositionTransform, VisibilitySwitch
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

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