Exemplo 54: - Animação 7
#VRML V2.0 utf8
Background {
skyColor 1 1 0
}
DEF ES1 Transform {
translation 0 0.1 0
children Shape {
appearance Appearance {
material Material{
diffuseColor 0 1 0
transparency 0.6
}
}
geometry Cylinder {
height 4.3
radius 1.6
}
}
}
DEF ES2 Transform {
children Shape {
appearance Appearance {
material Material{
diffuseColor 0 0 1
transparency 0.3
}
}
geometry Cylinder {
height 4
radius 1.5
}
}
}
DEF PI PositionInterpolator {
key [0 0.25 0.5 0.75 1]
keyValue [0 0 0, 0 -0.5 0, 0 -1.0 0, 0 -1.5 0, 0 -2.0 0]
}
DEF SI PositionInterpolator{
key [ 0 0.25 0.5 0.75 1 ]
keyValue [ 1 1 1 1 0.75 1 1 0.5 1 1 0.25 1 1 0.01 1 ]
}
DEF TS TimeSensor {
# loop TRUE
cycleInterval 12
}
DEF Touch TouchSensor {}
ROUTE Touch.touchTime TO TS.startTime
ROUTE TS.fraction_changed TO PI.set_fraction
ROUTE PI.value_changed TO ES2.translation
ROUTE TS.fraction_changed TO SI.set_fraction
ROUTE SI.value_changed TO ES2.scale
Exemplo 55: - Animação 8
DEF Esfera Transform {
......children Shape {
............appearance Appearance {
..................material Material { }
............}
............geometry Sphere {
..................radius 0.5
............}
......}
},
DEF Tempo TimeSensor {
......cycleInterval 5.0
......loop TRUE
},
DEF Caminho PositionInterpolator {
......key [ .0.00, 0.25, 0.50, 0.75, 1.00..]
......keyValue [ ..-6 0 0, 0 4 0, 6 0 0, 0 -4 0, -6 0 0..]
}
ROUTE Tempo.fraction_changed TO Caminho.set_fraction
ROUTE Caminho.value_changed TO Esfera.set_translation