<?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='title' content='Bounce3.x3d'/>
<meta name='description' content='ouncing beachball (with prototype and JavaScript): this world illustrates the use of a PROTO to encapsulate a Script node, timer, shape, and routes to create a vertically bouncing beach ball. The bounce path is based upon the projectile motion equation of physics, constrained to create a cyclic bouncing path with a user-selected maximum bounce height. Also, there is no friction, drag, or damping. For an explanation of the script, see bounce1.wrl.'/>
<meta name='creator' content='David R. Nadeau'/>
<meta name='translator' content='Don Brutzman'/>
<meta name='created' content='1 July 1998'/>
<meta name='translated' content='2 February 2014'/>
<meta name='modified' content='20 October 2019'/>
<meta name='reference' content='originals/bounce3.wrl'/>
<meta name='reference' content='
http://www.siggraph.org/s98
'/>
<meta name='reference' content='
http://www.siggraph.org/s98/conference/courses/18.html
'/>
<meta name='reference' content='
http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0487.htm
'/>
<meta name='reference' content='
http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm
'/>
<meta name='reference' content='
https://www.web3d.org/x3d/content/examples/X3dResources.html
'/>
<meta name='identifier' content='
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Bounce3.x3d
'/>
<meta name='generator' content='Vrml97ToX3dNist,
http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='generator' content='X3D-Edit,
https://savage.nps.edu/X3D-Edit'/>
<meta name='license' content='
../license.html'/>
</head>
<!--
-->
<Scene>
<WorldInfo info='"Copyright (c) 1997, David R. Nadeau"' title='Bouncing beachball (PROTO)'/>
<Viewpoint description='Bouncing beachball, with prototype and JavaScript' orientation='1.0 0.0 0.0 0.1' position='0.0 0.6 8.0'/>
<NavigationInfo headlight='false' speed='2.0'/>
<DirectionalLight ambientIntensity='0.5' direction='0.0 -1.0 -0.5'/>
<Background skyAngle='1.371 1.571' skyColor='0.0 0.0 1.0 0.0 0.5 1.0 0.7 0.7 1.0'/>
<Shape>
<Appearance>
</Appearance>
<IndexedFaceSet solid='false' coordIndex='0 1 2 3'>
<Coordinate point='-50.0 -1.0 50.0 50.0 -1.0 50.0 50.0 -1.0 -50.0 -50.0 -1.0 -50.0'/>
</IndexedFaceSet>
</Shape>
<Transform translation='-3.0 -1.0 -10.0'>
<Group DEF='Palm'>
<Billboard>
<Shape>
<Appearance>
</Appearance>
<IndexedFaceSet solid='false' coordIndex='0 1 2 3' texCoordIndex='0 1 2 3'>
<TextureCoordinate point='0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0'/>
<Coordinate point='-2.5 0.0 0.0 2.5 0.0 0.0 2.5 11.25 0.0 -2.5 11.25 0.0'/>
</IndexedFaceSet>
</Shape>
</Billboard>
<Shape>
<Appearance>
</Appearance>
<IndexedFaceSet solid='false' coordIndex='0 1 2 3' texCoordIndex='0 1 2 3'>
<TextureCoordinate point='0.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0'/>
<Coordinate point='-2.5 0.05 2.5 2.5 0.05 2.5 2.5 0.05 -2.5 -2.5 0.05 -2.5'/>
</IndexedFaceSet>
</Shape>
</Group>
</Transform>
<Transform scale='0.6 0.6 0.6' translation='-5.0 -1.0 -6.0'>
</Transform>
<Transform translation='5.0 -1.0 -9.0'>
</Transform>
<Transform translation='10.0 -1.0 -15.0'>
</Transform>
<ProtoDeclare name='BouncingBall'>
<ProtoInterface>
<field name='bounceTime' type='SFTime' value='1.0' accessType='initializeOnly'/>
<field name='bounceHeight' type='SFFloat' value='1.0' accessType='initializeOnly'/>
</ProtoInterface>
<ProtoBody>
<Shape>
<Appearance>
</Appearance>
<Sphere/>
</Shape>
</Transform>
<IS>
<connect nodeField='cycleInterval' protoField='bounceTime'/>
</IS>
</TimeSensor>
<field name='value_changed' type='SFVec3f' accessType='outputOnly'/>
<field name='bounceHeight' type='SFFloat' accessType='initializeOnly'/>
<field name='set_fraction' type='SFFloat' accessType='inputOnly'/>
<IS>
<connect nodeField='bounceHeight' protoField='bounceHeight'/>
</IS>
<![CDATA[
ecmascript:
function set_fraction( frac, tm ) {
y = 4.0 * bounceHeight * frac * (1.0 - frac);
value_changed[0] = 0.0;
value_changed[1] = y;
value_changed[2] = 0.0;
}
]]>
</Script>
<
ROUTE
fromNode='
Clock' fromField='fraction_changed' toNode='
Bouncer' toField='set_fraction'/>
<
ROUTE
fromNode='
Bouncer' fromField='value_changed' toNode='
Ball' toField='set_translation'/>
</ProtoBody>
</ProtoDeclare>
<ProtoInstance name='BouncingBall'>
<fieldValue name='bounceTime' value='2.0'/>
<fieldValue name='bounceHeight' value='3.0'/>
</ProtoInstance>
<Transform translation='2.0 0.0 -2.0'>
<ProtoInstance name='BouncingBall'>
<fieldValue name='bounceTime' value='2.2'/>
<fieldValue name='bounceHeight' value='2.5'/>
</ProtoInstance>
</Transform>
<Transform translation='-2.0 0.0 -2.0'>
<ProtoInstance name='BouncingBall'>
<fieldValue name='bounceTime' value='2.4'/>
<fieldValue name='bounceHeight' value='3.5'/>
</ProtoInstance>
</Transform>
</Scene>
</X3D>
<!--
-->
Event Graph ROUTE Table entries with 2 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.
ProtoInstance
BouncingBall
|
No ROUTE connection found for output from this node. Contains SFNode/MFNode field with indirect access to other nodes. |
ProtoInstance
BouncingBall
|
No ROUTE connection found for output from this node. Contains SFNode/MFNode field with indirect access to other nodes. |
ProtoInstance
BouncingBall
|
No ROUTE connection found for output from this node. Contains SFNode/MFNode field with indirect access to other nodes. |
-->
<!--
Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Bounce3Index.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Bounce3.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)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->