Script For Q1: The Animated Squares
Script For Q1: The Animated Squares
}
]
]
}
coordIndex [
0, 1, 6, 7, -1,
1, 2, 17, 16, -1,
2, 3, 4, 5, -1,
19, 18, 5, 6, -1,
11, 10, 13, 12, -1,
10, 9, 20, 21, -1,
9, 8, 15, 14, -1,
22, 23, 14, 13, -1,
3, 11, 12, 4, -1,
4, 12, 15, 7, -1,
8, 0, 7, 15, -1,
0, 8, 11, 3, -1,
16, 17, 21, 20, -1,
21, 17, 18, 22, -1,
19, 23, 22, 18, -1,
16, 20, 23, 19, -1,
]
}
# Orange frame
DEF Frame2 Transform {
translation 0.0 0.0 -0.4
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 1.0 0.5 0.0
}
}
geometry USE Frame
}
]
}
# Yellow frame
DEF Frame3 Transform {
translation 0.0 0.0 -0.8
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 1.0 1.0 0.0
}
}
geometry USE Frame
}
]
}
# Light green frame
DEF Frame4 Transform {
translation 0.0 0.0 -1.2
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 0.5 1.0 0.0
}
}
}
}
geometry USE Frame
# Green frame
DEF Frame5 Transform {
translation 0.0 0.0 -1.6
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 1.0 0.0
}
}
geometry USE Frame
}
]
}
# Light Cyan frame
DEF Frame6 Transform {
translation 0.0 0.0 -2.0
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 1.0 0.5
}
}
geometry USE Frame
}
]
}
# Cyan frame
DEF Frame7 Transform {
translation 0.0 0.0 -2.4
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 1.0 1.0
}
}
geometry USE Frame
}
]
}
# Dark Cyan frame
DEF Frame8 Transform {
translation 0.0 0.0 -2.8
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 0.0 0.5 1.0
}
}
geometry USE Frame
}
]
}
# Blue frame
DEF Frame9 Transform {
translation 0.0 0.0 -3.2
children [
Shape {
appearance Appearance {
material Material {
}
geometry USE Frame
]
}
# Trigger things on touch
DEF Touch TouchSensor { }
# Animation control
DEF Timer1 TimeSensor
DEF Timer2 TimeSensor
DEF Timer3 TimeSensor
DEF Timer4 TimeSensor
DEF Timer5 TimeSensor
DEF Timer6 TimeSensor
DEF Timer7 TimeSensor
DEF Timer8 TimeSensor
DEF Timer9 TimeSensor
{
{
{
{
{
{
{
{
{
cycleInterval
cycleInterval
cycleInterval
cycleInterval
cycleInterval
cycleInterval
cycleInterval
cycleInterval
cycleInterval
10.0
11.0
12.0
13.0
14.0
15.0
16.0
17.0
18.0
loop
loop
loop
loop
loop
loop
loop
loop
loop
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
startTime
startTime
startTime
startTime
startTime
startTime
startTime
startTime
startTime
-1
-1
-1
-1
-1
-1
-1
-1
-1
}
}
}
}
}
}
}
}
}
}
DEF Rot5 OrientationInterpolator {
key [ 0.0, 0.5, 1.0 ]
keyValue [ 0.0 0.0 1.0 0.0, 0.0
}
DEF Rot6 OrientationInterpolator {
key [ 0.0, 0.5, 1.0 ]
keyValue [ 0.0 0.0 1.0 0.0, 0.0
}
DEF Rot7 OrientationInterpolator {
key [ 0.0, 0.5, 1.0 ]
keyValue [ 0.0 0.0 1.0 0.0, 0.0
}
DEF Rot8 OrientationInterpolator {
key [ 0.0, 0.5, 1.0 ]
keyValue [ 0.0 0.0 1.0 0.0, 0.0
}
DEF Rot9 OrientationInterpolator {
key [ 0.0, 0.5, 1.0 ]
keyValue [ 0.0 0.0 1.0 0.0, 0.0
}
ROUTE
ROUTE
ROUTE
ROUTE
ROUTE
ROUTE
ROUTE
ROUTE
ROUTE
Touch.touchTime
Touch.touchTime
Touch.touchTime
Touch.touchTime
Touch.touchTime
Touch.touchTime
Touch.touchTime
Touch.touchTime
Touch.touchTime
TO
TO
TO
TO
TO
TO
TO
TO
TO
ROUTE
ROUTE
ROUTE
ROUTE
ROUTE
ROUTE
Timer1.fraction_changed
Timer2.fraction_changed
Timer3.fraction_changed
Timer4.fraction_changed
Timer5.fraction_changed
Timer6.fraction_changed
Timer1.set_startTime
Timer2.set_startTime
Timer3.set_startTime
Timer4.set_startTime
Timer5.set_startTime
Timer6.set_startTime
Timer7.set_startTime
Timer8.set_startTime
Timer9.set_startTime
TO
TO
TO
TO
TO
TO
Rot1.set_fraction
Rot2.set_fraction
Rot3.set_fraction
Rot4.set_fraction
Rot5.set_fraction
Rot6.set_fraction
Rot1.value_changed
Rot2.value_changed
Rot3.value_changed
Rot4.value_changed
Rot5.value_changed
Rot6.value_changed
Rot7.value_changed
Rot8.value_changed
Rot9.value_changed
TO
TO
TO
TO
TO
TO
TO
TO
TO
Frame1.set_rotation
Frame2.set_rotation
Frame3.set_rotation
Frame4.set_rotation
Frame5.set_rotation
Frame6.set_rotation
Frame7.set_rotation
Frame8.set_rotation
Frame9.set_rotation