Prototypes used in Victory Square ...comments.
#VRML V2.0 utf8
# door prototypes
PROTO Double_door [
field SFVec3f d_position 0 0 0
field SFRotation d_orientation 0 1 0 0
field SFVec3f prox_size 4 4 4
field SFVec3f door_scale 1 1 1
]
{
Transform {
translation IS d_position
rotation IS d_orientation
scale IS door_scale
children [
DEF door_prox ProximitySensor {size IS prox_size}
DEF door_move Transform {
center -1.5 0 0
translation 0 0 0
rotation 0 1 0 0
children [
DEF door_1 Group {
children [
Shape {
appearance Appearance {
material Material {
diffuseColor .4 .4 .4
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-1.5 1.5 0, -1.5 -1.5 0, -1.3 -1.5 0, -1.3 1.5 0,
-.2 1.5 0, -.2 -1.5 0, 0 -1.5 0, 0 1.5 0,
-1.3 1.5 0, -1.3 1.3 0, -.2 1.3 0, -.2 1.5 0,
-1.3 -1.3 0, -1.3 -1.5 0, -.2 -1.5 0, -.2 -1.3 0,
-1.5 1.5 -.1, -1.5 -1.5 -.1, -1.3 -1.5 -.1, -1.3 1.5 -.1,
-.2 1.5 -.1, -.2 -1.5 -.1, 0 -1.5 -.1, 0 1.5 -.1,
-1.3 1.5 -.1, -1.3 1.3 -.1, -.2 1.3 -.1, -.2 1.5 -.1,
-1.3 -1.3 -.1, -1.3 -1.5 -.1, -.2 -1.5 -.1, -.2 -1.3 -.1,
0 1.5 0, 0 -1.5 0, 0 -1.5 -.1, 0 1.5 -.1,
-1.5 1.5 -.1, -1.5 -1.5 -.1, -1.5 -1.5 0, -1.5 1.5 0,
]
}
coordIndex [
0 1 2 3 0 -1
4 5 6 7 4 -1
8 9 10 11 8 -1
12 13 14 15 12 -1
16 19 18 17 16 -1
20 23 22 21 20 -1
24 27 26 25 24 -1
28 31 30 29 28 -1
32 33 34 35 32 -1
36 37 38 39 36 -1
]
}
}
Shape {
appearance Appearance {
material Material {
diffuseColor .1 .1 .1
emissiveColor 0 .3 .1
transparency .2
shininess 1
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-1.35 1.35 -.05, -1.35 -1.35 -.05, -.15 -1.35 -.05, -.15 1.35 -.05,
]
}
coordIndex [
0 1 2 3 0 -1
0 3 2 1 0 -1
]
}
}
]
}
]
}
Transform {
translation 1.5 0 0
children [USE door_1]
}
DEF open_door TimeSensor {
cycleInterval 5
loop FALSE
}
DEF close_door TimeSensor {
cycleInterval 5
loop FALSE
}
DEF opening OrientationInterpolator {
key [0 1]
keyValue [0 1 0 0, 0 1 0 -1.57]
}
DEF closing OrientationInterpolator {
key [0 1]
keyValue [0 1 0 -1.57, 0 1 0 0]
}
ROUTE door_prox.enterTime TO open_door.startTime
ROUTE door_prox.exitTime TO close_door.startTime
ROUTE open_door.fraction_changed TO opening.set_fraction
ROUTE opening.value_changed TO door_move.set_rotation
ROUTE close_door.fraction_changed TO closing.set_fraction
ROUTE closing.value_changed TO door_move.set_rotation
]
}
}
PROTO Hall_door [
field SFVec3f d_position 0 0 0
field SFRotation d_orientation 0 1 0 0
field SFVec3f prox_size 8 8 8
field SFVec3f door_scale 1 1 1
]
{
Transform {
translation IS d_position
rotation IS d_orientation
scale IS door_scale
children [
DEF hall_door_prox ProximitySensor {size IS prox_size}
DEF hall_door_move Transform {
center -1.5 0 0
translation 0 0 0
rotation 0 1 0 0
children [
DEF hall_door_1 Group {
children [
Shape {
appearance Appearance {
material Material {
diffuseColor .3 .3 .2
specularColor .45 .45 .3
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-1.5 1.5 0, -1.5 -1.5 0, 0 -1.5 0, 0 1.5 0,
0 1.5 -.05, 0 -1.5 -.05, -1.5 -1.5 -.05, -1.5 1.5 -.05,
0 1.5 0, 0 -1.5 0, 0 -1.5 -.05, 0 1.5 -.05,
-1.5 1.5 -.05, -1.5 -1.5 -.05, -1.5 -1.5 0, -1.5 1.5 0,
]
}
coordIndex [
0 1 2 3 0 -1
4 5 6 7 4 -1
8 9 10 11 8 -1
12 13 14 15 12 -1
]
}
}
Shape {
appearance Appearance {
material Material {
diffuseColor .25 .25 .1
specularColor .3 .3 .3
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-1.2 1.2 .02, -1.2 -1.2 .02, -.3 -1.2 .02, -.3 1.2 .02
]
}
coordIndex [0 1 2 3 0 -1]
}
}
]
}
]
}
Transform {
translation 1.5 0 0
children [USE hall_door_1]
}
DEF open_hall_door TimeSensor {
cycleInterval 5
loop FALSE
}
DEF close_hall_door TimeSensor {
cycleInterval 5
loop FALSE
}
DEF hall_door_opening OrientationInterpolator {
key [0 1]
keyValue [0 1 0 0, 0 1 0 -1.57]
}
DEF hall_door_closing OrientationInterpolator {
key [0 1]
keyValue [0 1 0 -1.57, 0 1 0 0]
}
ROUTE hall_door_prox.enterTime TO open_hall_door.startTime
ROUTE hall_door_prox.exitTime TO close_hall_door.startTime
ROUTE open_hall_door.fraction_changed TO hall_door_opening.set_fraction
ROUTE hall_door_opening.value_changed TO hall_door_move.set_rotation
ROUTE close_hall_door.fraction_changed TO hall_door_closing.set_fraction
ROUTE hall_door_closing.value_changed TO hall_door_move.set_rotation
]
}
}