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

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: bendAngle, bendAngleLabel, CI, Crd1, Crd2, Crd3, FntColor, FntStyle, PS, Scr, White

Index for Viewpoint nodes: 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'/>

<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=' PS' fromField='translation_changed' toNode=' Scr' toField='set_translation'/>
< ROUTE  fromNode=' Scr' fromField='fraction_changed' toNode=' CI' toField='set_fraction'/>
< ROUTE  fromNode=' Scr' fromField='label_changed' toNode=' bendAngle' toField='set_string'/>
< ROUTE  fromNode=' CI' fromField='value_changed' toNode=' Crd1' toField='set_point'/>
< ROUTE  fromNode=' CI' fromField='value_changed' toNode=' Crd2' toField='set_point'/>
< ROUTE  fromNode=' CI' fromField='value_changed' toNode=' Crd3' toField='set_point'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: bendAngle, bendAngleLabel, CI, Crd1, Crd2, Crd3, FntColor, FntStyle, PS, Scr, White

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->

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

ROUTE
event to
(1)
Scr
Script
set_translation
SFVec3f

 
 
then
Scr
Script
fraction_changed
SFFloat

ROUTE
event to
(2)
CI
CoordinateInterpolator
set_fraction
SFFloat

 
 
then
CI
CoordinateInterpolator
value_changed
MFVec3f

ROUTE
event to
(3)
Crd1
Coordinate
set_point
MFVec3f
 
 
 
then
CI
CoordinateInterpolator
value_changed
MFVec3f

ROUTE
event to
(3)
Crd2
Coordinate
set_point
MFVec3f
 
 
 
then
CI
CoordinateInterpolator
value_changed
MFVec3f

ROUTE
event to
(3)
Crd3
Coordinate
set_point
MFVec3f
 
 
 
then
Scr
Script
label_changed
MFString

ROUTE
event to
(2)
bendAngle
Text
set_string
MFString


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/CreaseAngleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/CreaseAngle.x3d -->

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