do not nest
PROTO SelectableSnowboard [
eventOut MFString topTexture_set
eventOut MFString baseTexture_set
exposedField MFString topTexture []
exposedField MFString baseTexture []
exposedField SFVec3f location 0 0 0
exposedField MFString description []
eventOut MFString text_changed
] {
Transform {
translation IS location
children [
DEF CYLINDERSENSOR CylinderSensor {
}
DEF TRANS Transform {
children Transform {
rotation 1 0 0 1.57
children Snowboard {
topTexture IS topTexture
baseTexture IS baseTexture
}
}
}
]
}
DEF SCRIPT Script {
eventIn SFBool isActive
field MFString description IS description
eventOut MFString text_changed IS text_changed
field MFString topTexture IS topTexture
field MFString baseTexture IS baseTexture
eventOut MFString topTexture_set IS topTexture_set
eventOut MFString baseTexture_set IS baseTexture_set
url "javascript:
function isActive(v,t) {
if(v) {
text_changed = description;
topTexture_set = topTexture;
baseTexture_set = baseTexture;
}
}
"
}
ROUTE CYLINDERSENSOR.rotation_changed TO TRANS.set_rotation
ROUTE CYLINDERSENSOR.isActive TO SCRIPT.isActive
}
Transform {
translation -0.25 1.5 0
children Shape {
appearance Appearance {
material Material {
emissiveColor 1 1 1
}
}
geometry DEF SELECTION_TEXT Text {
string ["Select your board"]
fontStyle FontStyle {
justify ["BEGIN"]
size 0.3
}
}
}
}
Transform {
translation 2.5 0.5 -1
children Shape {
geometry Box{
size 8 5 0
}
appearance Appearance {
texture ImageTexture {
url "local/skate/mountain.jpg"
}
}
}
}