| 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=' CreaseAngle.x3d '/> |
| 6 | <meta name='description' content='creaseAngle demonstration: select and drag upper halves of quadrilaterals to change creaseAngle and shading.'/> |
| 7 | <meta name='creator' content='John L. Moreland'/> |
| 8 | <meta name='translator' content='Don Brutzman'/> |
| 9 | <meta name='created' content='1 July 1998'/> |
| 10 | <meta name='translated' content='2 February 2014'/> |
| 11 | <meta name='modified' content='20 October 2019'/> |
| 12 | <meta name='reference' content='originals/creangle.wrl'/> |
| 13 | <meta name='reference' content='http://www.siggraph.org/s98'/> |
| 14 | <meta name='reference' content=' http://www.siggraph.org/s98/conference/courses/18.html '/> |
| 15 | <meta name='reference' content=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0243.htm '/> |
| 16 | <meta name='reference' content=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm '/> |
| 17 | <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/> |
| 18 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/CreaseAngle.x3d '/> |
| 19 | <meta name='generator' content=' Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html '/> |
| 20 | <meta name='generator' content='X3D-Edit, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 21 | <meta name='license' content='../license.html'/> |
| 22 | </head> |
| 23 | <Scene> |
| 24 | <WorldInfo info='"copyright (c) 1997, John L. Moreland"' title='Crease angle demonstration'/> |
| 25 | <Viewpoint centerOfRotation='0 0.85 0' description='Front Face' orientation='0 1 0 -0.62' position='-2 0.85 3'/> |
| 26 | <Viewpoint centerOfRotation='0 0.85 0' description='Back Face' orientation='0.0 1.0 0.0 0.62' position='2.4 0.85 3.0'/> |
| 27 | <NavigationInfo/> |
| 28 | <DirectionalLight color='1.0 0.0 0.0' direction='0.0 -1.0 0.1'/> |
| 29 | <DirectionalLight color='0.0 0.0 1.0' direction='0.0 1.0 -0.1'/> |
| 30 | <Transform translation='-1.1 0.0 0.0'> |
| 31 | <Shape> |
| 32 | |
| 33 | <Material ambientIntensity='0.5' diffuseColor='1.0 1.0 1.0'/> |
| 34 | </Appearance> |
| 35 | <IndexedFaceSet solid='false' coordIndex='0 1 4 5 0 -1 1 2 3 4 1 -1'> |
| 36 |
<!-- ROUTE information for Crd1 node:
[from CI.value_changed to set_point
]
-->
<Coordinate DEF='Crd1' point='0.0 0.0 1.0 0.0 1.0 1.0 0.0 2.0 1.0 0.0 2.0 -1.0 0.0 1.0 -1.0 0.0 0.0 -1.0'/> |
| 37 | </IndexedFaceSet> |
| 38 | </Shape> |
| 39 | <Transform translation='0.0 1.0 1.2'> |
| 40 | <Billboard> |
| 41 | <Shape> |
| 42 | |
| 43 | <Material diffuseColor='1.0 0.0 0.0'/> |
| 44 | </Appearance> |
| 45 | <Text string='"0.0"'> |
| 46 | |
| 47 | </Text> |
| 48 | </Shape> |
| 49 |
<!-- Transform
bendAngleLabel is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
<Transform DEF='bendAngleLabel' translation='0.0 -0.1 0.0'> |
| 50 | <Shape> |
| 51 | <Appearance> |
| 52 | <Material diffuseColor='0.0 0.5 0.0'/> |
| 53 | </Appearance> |
| 54 |
<!-- ROUTE information for bendAngle node:
[from Scr.label_changed to set_string
]
-->
<Text DEF='bendAngle' string='"0.0"'> |
| 55 | <FontStyle USE='FntStyle'/> |
| 56 | </Text> |
| 57 | </Shape> |
| 58 | </Transform> |
| 59 | </Billboard> |
| 60 | </Transform> |
| 61 | </Transform> |
| 62 | <Transform> |
| 63 | <Shape> |
| 64 | <Appearance USE='White'/> |
| 65 | <IndexedFaceSet creaseAngle='0.785' solid='false' coordIndex='0 1 4 5 0 -1 1 2 3 4 1 -1'> |
| 66 |
<!-- ROUTE information for Crd2 node:
[from CI.value_changed to set_point
]
-->
<Coordinate DEF='Crd2' point='0.0 0.0 1.0 0.0 1.0 1.0 0.0 2.0 1.0 0.0 2.0 -1.0 0.0 1.0 -1.0 0.0 0.0 -1.0'/> |
| 67 | </IndexedFaceSet> |
| 68 | </Shape> |
| 69 | <Transform translation='0.0 1.0 1.2'> |
| 70 | <Billboard> |
| 71 | <Shape> |
| 72 | <Appearance USE='FntColor'/> |
| 73 | <Text string='"0.785"'> |
| 74 | <FontStyle USE='FntStyle'/> |
| 75 | </Text> |
| 76 | </Shape> |
| 77 | <Transform USE='bendAngleLabel'/> |
| 78 | </Billboard> |
| 79 | </Transform> |
| 80 | </Transform> |
| 81 | <Transform translation='1.1 0.0 0.0'> |
| 82 | <Shape> |
| 83 | <Appearance USE='White'/> |
| 84 | <IndexedFaceSet creaseAngle='1.57' solid='false' coordIndex='0 1 4 5 0 -1 1 2 3 4 1 -1'> |
| 85 |
<!-- ROUTE information for Crd3 node:
[from CI.value_changed to set_point
]
-->
<Coordinate DEF='Crd3' point='0.0 0.0 1.0 0.0 1.0 1.0 0.0 2.0 1.0 0.0 2.0 -1.0 0.0 1.0 -1.0 0.0 0.0 -1.0'/> |
| 86 | </IndexedFaceSet> |
| 87 | </Shape> |
| 88 | <Transform translation='0.0 1.0 1.2'> |
| 89 | <Billboard> |
| 90 | <Shape> |
| 91 | <Appearance USE='FntColor'/> |
| 92 | <Text string='"1.57"'> |
| 93 | <FontStyle USE='FntStyle'/> |
| 94 | </Text> |
| 95 | </Shape> |
| 96 | <Transform USE='bendAngleLabel'/> |
| 97 | </Billboard> |
| 98 | </Transform> |
| 99 | </Transform> |
| 100 |
<!-- ROUTE information for PS node:
[from translation_changed to Scr.set_translation
]
-->
<PlaneSensor DEF='PS' description='Select and drag upper halves of quads to change creaseAngle and shading' maxPosition='6.283 1.57'/> |
| 101 |
<!-- ROUTE information for Scr node:
[from PS.translation_changed to set_translation
]
[from fraction_changed to CI.set_fraction
]
[from label_changed to bendAngle.set_string
]
-->
<Script DEF='Scr'> |
| 102 | <field name='label_changed' type='MFString' accessType='outputOnly'/> |
| 103 | <field name='set_translation' type='SFVec3f' accessType='inputOnly'/> |
| 104 | <field name='fraction_changed' type='SFFloat' accessType='outputOnly'/> |
<![CDATA[
ecmascript:
function set_translation( tran, et )
{
tempCA = tran[0] / 4.0;
if ( tempCA < 0.00 ) tempCA = 0.0;
if ( tempCA > 1.57 ) tempCA = 1.57;
fraction_changed = tempCA;
// Hacks to get truncation/formatting
tempCA = (Math.floor(tempCA*1000)/1000.0);
if ( (tempCA > 0.1) && (tempCA < 1.0) )
tempCA = '0' + tempCA;
if ( tempCA <= 0.0 )
tempCA = tempCA + '.' + '0';
label_changed[0] = tempCA;
}
]]>
|
|
| 106 | </Script> |
| 107 |
<!-- ROUTE information for CI node:
[from Scr.fraction_changed to set_fraction
]
[from value_changed to Crd1.set_point
]
[from value_changed to Crd2.set_point
]
[from value_changed to Crd3.set_point
]
-->
<CoordinateInterpolator DEF='CI' key='0.0 1.57' keyValue='0.0 0.0 1.0 0.0 1.0 1.0 0.0 2.0 1.0 0.0 2.0 -1.0 0.0 1.0 -1.0 0.0 0.0 -1.0 0.0 0.0 1.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 -1.0 0.0 1.0 -1.0 0.0 0.0 -1.0'/> |
| 108 | < ROUTE fromNode='PS' fromField='translation_changed' toNode='Scr' toField='set_translation'/> |
| 109 | < ROUTE fromNode='Scr' fromField='fraction_changed' toNode='CI' toField='set_fraction'/> |
| 110 | < ROUTE fromNode='Scr' fromField='label_changed' toNode='bendAngle' toField='set_string'/> |
| 111 | < ROUTE fromNode='CI' fromField='value_changed' toNode='Crd1' toField='set_point'/> |
| 112 | < ROUTE fromNode='CI' fromField='value_changed' toNode='Crd2' toField='set_point'/> |
| 113 | < ROUTE fromNode='CI' fromField='value_changed' toNode='Crd3' toField='set_point'/> |
| 114 | </Scene> |
| 115 | </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.
|
PS
PlaneSensor translation_changed SFVec3f |
Scr
Script set_translation SFVec3f |
then
|
Scr
Script fraction_changed SFFloat |
CI
CoordinateInterpolator set_fraction SFFloat |
then
|
CI
CoordinateInterpolator value_changed MFVec3f |
Crd1
Coordinate set_point MFVec3f |
|||
|
then
|
CI
CoordinateInterpolator value_changed MFVec3f |
Crd2
Coordinate set_point MFVec3f |
||||||||
|
then
|
CI
CoordinateInterpolator value_changed MFVec3f |
Crd3
Coordinate set_point MFVec3f |
||||||||
|
then
|
Scr
Script label_changed MFString |
bendAngle
Text set_string MFString |
||||||||
<!--
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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->