|
In a message dated 04/03/2005 21:24:31 GMT Standard Time,
miriam@werple.net.au writes:
This means that if you want to send events in or out of PROTOs you are forced to use Scripts in there to mediate. This is not too bad (though clumsy) if the events are rare like mouse clicks or similar, but if the PROTO has to send or receive large streams of data (like time from a TimeSensor or position from a ProximitySensor) then having to pipe everything through a Script makes large, complex worlds almost impossible. Surely not, or have I misunderstood the question?
Sorry this is a bit verbose; you can generate a lot of code with
cut-and-paste. Lots of ROUTEs but not a Script in sight.
Bryan Creer
#VRML V2.0 utf8
WorldInfo { title "Wave" } DEF NavInfo NavigationInfo {
headlight FALSE } DirectionalLight {
ambientIntensity 0.5 direction 1 -0.5 -1 } Fog {
color .5 .5 1 visibilityRange 100 } Background {
skyColor [0 0 .5, .2 .2 .8, .5 .5 1] skyAngle [1.25, 1.57] } DEF Front Viewpoint {
position 0 1.6 15 description "Front" } DEF Aerial Viewpoint {
position 0 15 30 orientation 1 0 0 -0.5 description "Aerial South" } PROTO Ball [
field SFVec3f BallStartPos 0 0 0 field MFVec3f BallHeight 0 0 0 eventIn SFFloat set_fraction ] { Group { children [ DEF BallPos Transform { translation IS BallStartPos children [ Shape { appearance Appearance { material Material { shininess 1 specularColor 1 1 1 diffuseColor 1 0 0 } } geometry Sphere { radius 0.5 } } ] } DEF Rod Shape
{
appearance Appearance { material Material { diffuseColor 1 1 1 } } geometry Cylinder { height 5 radius 0.1 } } ] } DEF BallMove PositionInterpolator
{
key [ 0.000, 0.083, 0.167, 0.250, 0.333, 0.417, 0.500, 0.583, 0.667, 0.750, 0.833, 0.917, 1.000, ] keyValue IS BallHeight set_fraction IS set_fraction } ROUTE BallMove.value_changed TO BallPos.set_translation
}
Transform {
translation -100 0 -100 children [ DEF Ground Shape { appearance Appearance { material Material { ambientIntensity .5 diffuseColor 0 1 .20 } } geometry ElevationGrid { xDimension 3 zDimension 3 xSpacing 100 zSpacing 100 creaseAngle 1.5 height [ 0, 0, 0, 0, 0, 0, 0, 0, 0, ] } } ] } Transform {
translation 0 0.25 0 children [ DEF Beam Shape { appearance Appearance { material Material { diffuseColor 1 0.5 0.5 } } geometry Box { size 13 0.5 1 } } ] } Transform { translation 0 5.75 0 children [ USE Beam ] } Transform { translation -5.5 3 0 children [ DEF Ball01 Ball { BallStartPos 0 0 0 BallHeight [ 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0 ] } ] } Transform {
translation -4.5 3 0 children [ DEF Ball02 Ball { BallStartPos 0 0 0 BallHeight [ 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0 ] } ] } Transform {
translation -3.5 3 0 children [ DEF Ball03 Ball { BallStartPos 0 0 0 BallHeight [ 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0 ] } ] } Transform {
translation -2.5 3 0 children [ DEF Ball04 Ball { BallStartPos 0 0 0 BallHeight [ 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0 ] } ] } Transform {
translation -1.5 3 0 children [ DEF Ball05 Ball { BallStartPos 0 0 0 BallHeight [ 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0 ] } ] } Transform {
translation -0.5 3 0 children [ DEF Ball06 Ball { BallStartPos 0 0 0 BallHeight [ 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0 ] } ] } Transform {
translation 0.5 3 0 children [ DEF Ball07 Ball { BallStartPos 0 0 0 BallHeight [ 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0 ] } ] } Transform {
translation 1.5 3 0 children [ DEF Ball08 Ball { BallStartPos 0 0 0 BallHeight [ 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0 ] } ] } Transform {
translation 2.5 3 0 children [ DEF Ball09 Ball { BallStartPos 0 0 0 BallHeight [ 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0 ] } ] } Transform {
translation 3.5 3 0 children [ DEF Ball10 Ball { BallStartPos 0 0 0 BallHeight [ 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0, 0 2 0 ] } ] } Transform {
translation 4.5 3 0 children [ DEF Ball11 Ball { BallStartPos 0 0 0 BallHeight [ 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0, 0 1.732 0 ] } ] } Transform {
translation 5.5 3 0 children [ DEF Ball12 Ball { BallStartPos 0 0 0 BallHeight [ 0 1 0, 0 1.732 0, 0 2 0, 0 1.732 0, 0 1 0, 0 0 0, 0 -1 0, 0 -1.732 0, 0 -2 0, 0 -1.732 0, 0 -1 0, 0 0 0, 0 1 0 ] } ] } DEF Clock1 TimeSensor {
cycleInterval 2.0 loop TRUE } ROUTE Clock1.fraction_changed TO Ball01.set_fraction ROUTE Clock1.fraction_changed TO Ball02.set_fraction ROUTE Clock1.fraction_changed TO Ball03.set_fraction ROUTE Clock1.fraction_changed TO Ball04.set_fraction ROUTE Clock1.fraction_changed TO Ball05.set_fraction ROUTE Clock1.fraction_changed TO Ball06.set_fraction ROUTE Clock1.fraction_changed TO Ball07.set_fraction ROUTE Clock1.fraction_changed TO Ball08.set_fraction ROUTE Clock1.fraction_changed TO Ball09.set_fraction ROUTE Clock1.fraction_changed TO Ball10.set_fraction ROUTE Clock1.fraction_changed TO Ball11.set_fraction ROUTE Clock1.fraction_changed TO Ball12.set_fraction |