<?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='CreaseAngle.x3d'/>
<meta name='descriptioncontent='creaseAngle demonstration: select and drag upper halves of quadrilaterals to change creaseAngle and shading.'/>
<meta name='creatorcontent='John L. Moreland'/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='1 July 1998'/>
<meta name='translatedcontent='2 February 2014'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent='originals/creangle.wrl'/>
<meta name='referencecontent=' http://www.siggraph.org/s98 '/>
<meta name='referencecontent=' http://www.siggraph.org/s98/conference/courses/18.html '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0243.htm '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/CreaseAngle.x3d '/>
<meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for DEF nodes : bendAngle, bendAngleLabel, CI, Crd1, Crd2, Crd3, FntColor, FntStyle, PS, Scr, White

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->
<Scene>
<WorldInfo info='"copyright (c) 1997, John L. Moreland"title='Crease angle demonstration'/>
<Viewpoint centerOfRotation='0 0.85 0description='Front Faceorientation='0 1 0 -0.62position='-2 0.85 3'/>
<Viewpoint centerOfRotation='0 0.85 0description='Back Faceorientation='0.0 1.0 0.0 0.62position='2.4 0.85 3.0'/>
<NavigationInfo/>
<DirectionalLight color='1.0 0.0 0.0direction='0.0 -1.0 0.1'/>
<DirectionalLight color='0.0 0.0 1.0direction='0.0 1.0 -0.1'/>
<Transform translation='-1.1 0.0 0.0'>
<Shape>
<Appearance DEF='White'>
<Material ambientIntensity='0.5diffuseColor='1.0 1.0 1.0'/>
</Appearance>
<IndexedFaceSet solid='falsecoordIndex='0 1 4 5 0 -1 1 2 3 4 1 -1'>
<!-- ROUTE information for Crd1 node:  [from CI.value_changed to set_point ] -->
<Coordinate DEF='Crd1point='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'/>
</IndexedFaceSet>
</Shape>
<Transform translation='0.0 1.0 1.2'>
<Billboard>
<Shape>
<Appearance DEF='FntColor'>
<Material diffuseColor='1.0 0.0 0.0'/>
</Appearance>
<Text string='"0.0"'>
<FontStyle DEF='FntStylejustify='"BEGIN" "MIDDLE"size='0.1style='BOLD'/>
</Text>
</Shape>
<Transform DEF='bendAngleLabeltranslation='0.0 -0.1 0.0'>
<Shape>
<Appearance>
<Material diffuseColor='0.0 0.5 0.0'/>
</Appearance>
<!-- ROUTE information for bendAngle node:  [from Scr.label_changed to set_string ] -->
<Text DEF='bendAnglestring='"0.0"'>
<FontStyle USE='FntStyle'/>
</Text>
</Shape>
</Transform>
</Billboard>
</Transform>
</Transform>
<Transform>
<Shape>
<Appearance USE='White'/>
<IndexedFaceSet creaseAngle='0.785solid='falsecoordIndex='0 1 4 5 0 -1 1 2 3 4 1 -1'>
<!-- ROUTE information for Crd2 node:  [from CI.value_changed to set_point ] -->
<Coordinate DEF='Crd2point='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'/>
</IndexedFaceSet>
</Shape>
<Transform translation='0.0 1.0 1.2'>
<Billboard>
<Shape>
<Appearance USE='FntColor'/>
<Text string='"0.785"'>
<FontStyle USE='FntStyle'/>
</Text>
</Shape>
<Transform USE='bendAngleLabel'/>
</Billboard>
</Transform>
</Transform>
<Transform translation='1.1 0.0 0.0'>
<Shape>
<Appearance USE='White'/>
<IndexedFaceSet creaseAngle='1.57solid='falsecoordIndex='0 1 4 5 0 -1 1 2 3 4 1 -1'>
<!-- ROUTE information for Crd3 node:  [from CI.value_changed to set_point ] -->
<Coordinate DEF='Crd3point='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'/>
</IndexedFaceSet>
</Shape>
<Transform translation='0.0 1.0 1.2'>
<Billboard>
<Shape>
<Appearance USE='FntColor'/>
<Text string='"1.57"'>
<FontStyle USE='FntStyle'/>
</Text>
</Shape>
<Transform USE='bendAngleLabel'/>
</Billboard>
</Transform>
</Transform>
<!-- ROUTE information for PS node:  [from translation_changed to Scr.set_translation ] -->
<PlaneSensor DEF='PSdescription='Select and drag upper halves of quads to change creaseAngle and shadingmaxPosition='6.283 1.57'/>
<!-- 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'>
<field name='label_changedtype='MFStringaccessType='outputOnly'/>
<field name='set_translationtype='SFVec3faccessType='inputOnly'/>
<field name='fraction_changedtype='SFFloataccessType='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;
        }

    
]]>
</Script>
<!-- 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='CIkey='0.0 1.57keyValue='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'/>
<ROUTE fromNode='PSfromField='translation_changedtoNode='ScrtoField='set_translation'/>
<ROUTE fromNode='ScrfromField='fraction_changedtoNode='CItoField='set_fraction'/>
<ROUTE fromNode='ScrfromField='label_changedtoNode='bendAngletoField='set_string'/>
<ROUTE fromNode='CIfromField='value_changedtoNode='Crd1toField='set_point'/>
<ROUTE fromNode='CIfromField='value_changedtoNode='Crd2toField='set_point'/>
<ROUTE fromNode='CIfromField='value_changedtoNode='Crd3toField='set_point'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : bendAngle, bendAngleLabel, CI, Crd1, Crd2, Crd3, FntColor, FntStyle, PS, Scr, White

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->

<!-- 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)
-->

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