| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
| 3 | <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'> |
| 4 | <head> |
| 5 | <meta name='title' content=' ViewFrustumPrototype.x3d '/> |
| 6 | <meta name='description' content='Define a view frustum associated with a given pair of Viewpoint and NavigationInfo nodes, provided as a reusable prototype.'/> |
| 7 | <meta name='creator' content='Don Brutzman'/> |
| 8 | <meta name='translated' content='16 August 2008'/> |
| 9 | <meta name='modified' content='27 November 2024'/> |
| 10 | <meta name='reference' content=' ViewFrustumExample.x3d '/> |
| 11 | <meta name='drawing' content='ViewFrustumComputation.png'/> |
| 12 |
<meta name='Image' content='ViewFrustumOverheadView.png' />
|
| 13 |
<meta name='Image' content='ViewFrustumObliqueView.png' />
|
| 14 | <meta name='subject' content='view culling frustum'/> |
| 15 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototype.x3d '/> |
| 16 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 17 | <meta name='license' content='../license.html'/> |
| 18 | </head> |
| 19 | <Scene> |
| 20 | <WorldInfo title='ViewFrustumPrototype.x3d'/> |
| 21 | <ProtoDeclare name='ViewFrustum' appinfo='Display view frustum associated with a given pair of Viewpoint NavigationInfo nodes'> |
| 22 | <ProtoInterface> |
| 23 |
<field name='ViewpointNode' type='SFNode' accessType='initializeOnly'
appinfo='required: insert Viewpoint DEF or USE node for view of interest'> |
| 24 | <!-- NULL node, ProtoInstance must provide --> |
| 25 | </field> |
| 26 |
<field name='NavigationInfoNode' type='SFNode' accessType='initializeOnly'
appinfo='required: insert NavigationInfo DEF or USE node of interest'> |
| 27 | <!-- NULL node, ProtoInstance must provide --> |
| 28 | </field> |
| 29 |
<field name='visible' type='SFBool' value='true' accessType='inputOutput'
appinfo='whether or not frustum geometry is rendered'/> |
| 30 |
<field name='lineColor' type='SFColor' value='0.9 0.9 0.9' accessType='inputOutput'
appinfo='RGB color of ViewFrustum outline, default value 0.9 0.9 0.9'/> |
| 31 |
<field name='frustumColor' type='SFColor' value='0.8 0.8 0.8' accessType='inputOutput'
appinfo='RGB color of ViewFrustum hull geometry, default value 0.8 0.8 0.8'/> |
| 32 |
<field name='transparency' type='SFFloat' value='0.5' accessType='inputOutput'
appinfo='transparency of ViewFrustum hull geometry, default value 0.5'/> |
| 33 |
<field name='aspectRatio' type='SFFloat' value='0.75' accessType='inputOutput'
appinfo='assumed ratio height/width, default value 0.75'/> |
| 34 |
<field name='trace' type='SFBool' value='false' accessType='initializeOnly'
appinfo='debug support, default false'/> |
| 35 | </ProtoInterface> |
| 36 | <ProtoBody> |
| 37 |
<!-- ROUTE information for VisibilitySwitch node:
[from GeometryComputationScript.visibilitySwitchSelection to whichChoice
]
-->
<Switch DEF='VisibilitySwitch' whichChoice='-1'> |
| 38 |
<!-- ROUTE information for PositionTransform node:
[from GeometryComputationScript.position_changed to translation
]
-->
<Transform DEF='PositionTransform' rotation='0 1 0 3.14159'> |
| 39 |
<!-- ROUTE information for OrientationTransform node:
[from GeometryComputationScript.orientation_changed to rotation
]
-->
<Transform DEF='OrientationTransform'> |
| 40 | <Shape> |
| 41 | <IndexedLineSet DEF='FrustumLines' coordIndex='0 1 2 3 0 -1 4 5 6 7 4 -1 0 4 -1 1 5 -1 2 6 -1 3 7 -1'> |
| 42 |
<!-- Coordinate
FrustumCoordinate is a DEF node that has 1 USE node: USE_1
<!-- ROUTE information for FrustumCoordinate node: [from GeometryComputationScript.point_changed to point ] --> <Coordinate DEF='FrustumCoordinate' point='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'/> |
| 43 | </IndexedLineSet> |
| 44 | <Appearance> |
| 45 | <Material> |
| 46 | <IS> |
| 47 | <connect nodeField='emissiveColor' protoField='lineColor'/> |
| 48 | </IS> |
| 49 | </Material> |
| 50 | </Appearance> |
| 51 | </Shape> |
| 52 | <Shape> |
| 53 |
<!-- Extrusion
FrustumExtrusion is a DEF node that has 1 USE node: USE_1
<!-- ROUTE information for FrustumExtrusion node: [from GeometryComputationScript.spine_changed to set_spine ] [from GeometryComputationScript.scale_changed to set_scale ] --> <Extrusion DEF='FrustumExtrusion'/> |
| 54 |
<!-- Appearance
FrustumAppearance is a DEF node that has 1 USE node: USE_1 -->
<Appearance DEF='FrustumAppearance'> |
| 55 | <Material> |
| 56 | <IS> |
| 57 | <connect nodeField='diffuseColor' protoField='frustumColor'/> |
| 58 | <connect nodeField='transparency' protoField='transparency'/> |
| 59 | </IS> |
| 60 | </Material> |
| 61 | </Appearance> |
| 62 | </Shape> |
| 63 | <Shape> |
| 64 | <Sphere radius='0.08'/> |
| 65 | <Appearance USE='FrustumAppearance'/> |
| 66 | </Shape> |
| 67 | </Transform> |
| 68 | </Transform> |
| 69 | </Switch> |
| 70 |
<!-- 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='GeometryComputationScript' directOutput='true' url=' "ViewFrustumPrototypeScript.js" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumPrototypeScript.js" '> |
| 71 |
<field name='visible' type='SFBool' accessType='inputOutput'
appinfo='Whether or not frustum geometry is rendered'/> |
| 72 |
<field name='visibilitySwitchSelection' type='SFInt32' accessType='outputOnly'
appinfo='Adjust Switch selection to make geometry visible or not'/> |
| 73 | <field name='ViewpointNode' type='SFNode' accessType='initializeOnly'/> |
| 74 | <field name='NavigationInfoNode' type='SFNode' accessType='initializeOnly'/> |
| 75 | <field name='FrustumCoordinate' type='SFNode' accessType='initializeOnly'> |
| 76 | <Coordinate USE='FrustumCoordinate'/> |
| 77 | </field> |
| 78 | <field name='FrustumExtrusion' type='SFNode' accessType='initializeOnly'> |
| 79 | <Extrusion USE='FrustumExtrusion'/> |
| 80 | </field> |
| 81 | <field name='recompute' type='SFBool' accessType='inputOnly'/> |
| 82 |
<field name='aspectRatio' type='SFFloat' accessType='inputOutput'
appinfo='assumed ratio height/width'/> |
| 83 | <field name='position_changed' type='SFVec3f' accessType='outputOnly'/> |
| 84 | <field name='orientation_changed' type='SFRotation' accessType='outputOnly'/> |
| 85 | <field name='spine_changed' type='MFVec3f' accessType='outputOnly'/> |
| 86 | <field name='scale_changed' type='MFVec2f' accessType='outputOnly'/> |
| 87 | <field name='point_changed' type='MFVec3f' accessType='outputOnly'/> |
| 88 | <field name='trace' type='SFBool' accessType='initializeOnly'/> |
| 89 | <IS> |
| 90 | <connect nodeField='visible' protoField='visible'/> |
| 91 | <connect nodeField='ViewpointNode' protoField='ViewpointNode'/> |
| 92 | <connect nodeField='NavigationInfoNode' protoField='NavigationInfoNode'/> |
| 93 | <connect nodeField='aspectRatio' protoField='aspectRatio'/> |
| 94 | <connect nodeField='trace' protoField='trace'/> |
| 95 | </IS> |
| 96 | </Script> |
| 97 | < ROUTE fromNode='GeometryComputationScript' fromField='visibilitySwitchSelection' toNode='VisibilitySwitch' toField='whichChoice'/> |
| 98 | < ROUTE fromNode='GeometryComputationScript' fromField='position_changed' toNode='PositionTransform' toField='translation'/> |
| 99 | < ROUTE fromNode='GeometryComputationScript' fromField='orientation_changed' toNode='OrientationTransform' toField='rotation'/> |
| 100 | < ROUTE fromNode='GeometryComputationScript' fromField='spine_changed' toNode='FrustumExtrusion' toField='set_spine'/> |
| 101 | < ROUTE fromNode='GeometryComputationScript' fromField='scale_changed' toNode='FrustumExtrusion' toField='set_scale'/> |
| 102 | < ROUTE fromNode='GeometryComputationScript' fromField='point_changed' toNode='FrustumCoordinate' toField='point'/> |
| 103 | </ProtoBody> |
| 104 | </ProtoDeclare> |
| 105 | <!-- Example use is in separate scene --> |
| 106 | <Anchor description='ViewFrustum Example' url=' "ViewFrustumExample.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumExample.x3d" "ViewFrustumExample.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/ViewFrustumExample.wrl" '> |
| 107 | <Shape> |
| 108 | <Appearance> |
| 109 | <Material diffuseColor='0.8 0.4 0'/> |
| 110 | </Appearance> |
| 111 | <Text string='"ViewFrustumPrototype.x3d" "is a Prototype declaration file." "For an example scene using the prototype," "click this text and view" "ViewFrustumExample.x3d"'> |
| 112 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.8'/> |
| 113 | </Text> |
| 114 | </Shape> |
| 115 | </Anchor> |
| 116 | </Scene> |
| 117 | </X3D> |
Event Graph ROUTE Table entries with 6 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.
|
GeometryComputationScript
Script visibilitySwitchSelection SFInt32 |
VisibilitySwitch
Switch whichChoice SFInt32 |
|
|
GeometryComputationScript
Script position_changed SFVec3f |
PositionTransform
Transform translation SFVec3f |
|
|
GeometryComputationScript
Script orientation_changed SFRotation |
OrientationTransform
Transform rotation SFRotation |
|
|
GeometryComputationScript
Script spine_changed MFVec3f |
FrustumExtrusion
Extrusion set_spine MFVec3f |
|
|
GeometryComputationScript
Script scale_changed MFVec2f |
FrustumExtrusion
Extrusion set_scale MFVec2f |
|
|
GeometryComputationScript
Script point_changed MFVec3f |
FrustumCoordinate
Coordinate point MFVec3f |
| line 106
Anchor |
description='ViewFrustum Example' User-interaction hint for this node. |
<!--
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)
<ProtoDeclare name='ProtoName'>
<field
name='fieldName'/> </ProtoDeclare>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->