image
Web3D/VR
#@extern @vr-extern-proto-object-box.wrl
PROTO Image [
exposedField SFVec3f scale 1 1 1
exposedField SFColor color 0.3 0.3 0.3
exposedField SFFloat transparency 0
exposedField SFBool touchEnabled FALSE
eventOut SFTime touchTime
field SFVec2f position 0 0
field SFVec2f size 1 1
exposedField MFString url []
] {
DEF TRANS Transform {
scale IS scale
children [
Group {
children [
DEF TOUCHSENSOR TouchSensor {
enabled IS touchEnabled
touchTime IS touchTime
}
Shape {
appearance Appearance {
material Material {
transparency IS transparency
emissiveColor IS color
diffuseColor 0 0 0
texture ImageTexture {
url IS url
}
}
}
geometry DEF WINDOWBOX box { }
}
]
}
]
}
DEF SCRIPT Script {
field SFNode transformNode USE TRANS
eventOut SFVec3f set_size
field SFVec2f position IS position
field SFVec2f size IS size
url "vrmlscript:
function initialize() {
transformNode.translation =
new SFVec3f(position.x,position.y,0);
set_size = new SFVec3f(size.x,size.y,0.02);
}
"
}
ROUTE SCRIPT.set_size TO WINDOWBOX.size
}