media @ VU
proto-slide-interface-interface.vr
proto-slide-interface-interface.vr
(wrl
)
[ flux /
bitmanagement /
cortona /
octaga
]
interface
Web3D/VR
proto
PROTO SlideInterface [
exposedField SFNode slide_set NULL
exposedField SFVec3f location 0 0 0
exposedField SFVec3f scale 1 1 1
exposedField SFRotation rotation 0 1 0 0
exposedField SFFloat transparency 0.9
exposedField SFColor color 0.4 0.4 0.4
exposedField SFColor knob 0.5 0.5 0.5
eventIn SFInt32 dlp
]
{
body
Transform {
translation IS location
scale IS scale
rotation IS rotation
children [
DEF RED Appearance {
material Material {
emissiveColor 1 0 0
diffuseColor 1 0 0
transparency 0.7
}
}
DEF WHITE Appearance {
material Material {
emissiveColor 1 1 1
diffuseColor 1 1 1
transparency 0.6
}
}
DEF YELLOW Appearance {
material Material {
emissiveColor 1 1 0
diffuseColor 1 1 0
transparency 0.6
}
}
DEF BLUE Appearance {
material Material {
emissiveColor 0 0 1
diffuseColor 0 0 1
transparency 0.7
}
}
Switch {
whichChoice -1
choice [
DEF C_SHAPE Shape {
appearance DEF APPEARANCE Appearance {
material Material {
emissiveColor 0 0 0
diffuseColor 0.5 0.5 0.5
specularColor 0.3 0.3 0.3
transparency 0.7
}
}
geometry Sphere { radius 0.5 }
}
DEF ARROW_SHAPE Shape {
appearance DEF APPEARANCE Appearance {
material Material {
emissiveColor 0 0 0
diffuseColor 0.5 0.5 0.5
specularColor 0.3 0.3 0.3
transparency IS transparency
}
}
geometry Extrusion {
convex FALSE
crossSection [ -1.0 0.0,
-0.0 0.5,
-0.0 0.2,
1.0 0.2,
1.0 -0.2,
-0.0 -0.2,
-0.0 -0.5,
-1.0 0.0 ]
spine [ 0 0.0 0,
0 0.2 0 ]
}
}
DEF SPHERE_SHAPE Shape {
appearance USE APPEARANCE
geometry Sphere { radius 0.5 }
}
DEF BOX_SHAPE Shape {
appearance USE APPEARANCE
geometry Box {}
}
DEF BAR_SHAPE Shape {
appearance USE APPEARANCE
geometry Box { size 0.07 0.04 0.04 }
}
DEF WHITEBAR Shape {
appearance USE WHITE
geometry Box { size 0.07 0.04 0.04 }
}
DEF REDBAR Shape {
appearance USE RED
geometry Box { size 0.07 0.04 0.04 }
}
DEF BLUEBAR Shape {
appearance USE BLUE
geometry Box { size 0.07 0.04 0.04 }
}
DEF YELLOWBAR Shape {
appearance USE YELLOW
geometry Box { size 0.07 0.04 0.04 }
}
]
}
HUD implementation
Transform {
scale 0.8 1 0.5
##translation 0 -3 0
children [
Transform {
translation 10 -4 0
children [
DEF C_TOUCH_SENSOR TouchSensor {}
Transform {
rotation 1 0 0 1.57
scale 0.5 1.5 1
children USE C_SHAPE
}
]
}
DEF switch Switch {
whichChoice 0
choice [
DEF group Group {
children [
DEF index_switch Switch {
whichChoice 0
choice [
Transform {
scale 20 20 10
translation 0 -3.5 -1
children [
Anchor {
url "@vr-proto-slide-interface-interface.html"
##url "index.html"
parameter []
children USE BAR_SHAPE
}
]
}
] }
DEF dlp_switch Switch {
whichChoice -1
choice [
Group { children [
Transform {
scale 20 20 10
translation 0 -3.5 -1
children [
DEF touch_white TouchSensor {}
Group { children USE WHITEBAR }
]
}
Transform {
scale 20 20 10
translation 2 -3.5 -1
children [
DEF touch_blue TouchSensor {}
Group { children USE WHITEBAR }
]
}
Transform {
scale 20ë‘|§2|×.html>TouchSensor {}
Group { children USE BLUEBAR }
]
}
Transform {
scale 20 20 10
translation -2 -3.5 -1
children [
DEF touch_red TouchSensor {}
Group { children USE REDBAR }
]
}
] }
] } ## Switch
'PREVIOUS' Button
Transform {
##translation -0.5 -0.35 -1
translation -7 -3 0
children [
DEF PREVIOUS_TOUCH_SENSOR TouchSensor {}
Transform {
rotation 1 0 0 1.57
scale 0.5 1.5 1
##scal10 5 0.05 0.05 0.05
children USE ARROW_SHAPE
##children USE SPHERE_SHAPE
}
]
}
'NEXT' Button
Transform {
translation 7 -3 0
children [
DEF NEXT_TOUCH_SENSOR TouchSensor {}
Transform {
rotation 0 0.706 0.706 3.1415
scale 0.5 1.5 1
##scale 0.05 0.05 0.05
## children USE SPHERE_SHAPE
children USE ARROW_SHAPE
}
]
}
] }
] }
script
DEF SCRIPT Script {
directOutput TRUE
eventIn SFInt32 dlp IS dlp
eventIn SFTime toggle
eventIn SFTime bar_white
eventIn SFTime bar_red
eventIn SFTime bar_blue
field SFNode me USE SCRIPT
field SFNode previous USE PREVIOUS_TOUCH_SENSOR
field SFNode next USE NEXT_TOUCH_SENSOR
field SFNode button USE C_TOUCH_SENSOR
field SFNode white USE touch_white
field SFNode red USE touch_red
field SFNode blue USE touch_blue
field SFNode index_switch USE index_switch
field SFNode dlp_switch USE dlp_switch
field SFNode xswitch USE switch
field SFNode slide_set IS slide_set
field SFInt32 state 0
url "vrmlscript:
function initialize() {
Browser.addRoute(previous,'touchTime',slide_set,'previous');
Browser.addRoute(next,'touchTime',slide_set,'next');
Browser.addRoute(button,'touchTime',me,'toggle');
Browser.addRoute(white,'touchTime',me,'bar_white');
Browser.addRoute(red,'touchTime',me,'bar_red');
Browser.addRoute(blue,'touchTime',me,'bar_blue');
}
function shutdown() {
Browser.deleteRoute(previous,'touchTime',slide_set,'previous');
Browser.deleteRoute(next,'touchTime',slide_set,'next');
Browser.deleteRoute(button,'touchTime',me,'toggle');
Browser.deleteRoute(white,'touchTime',me,'bar_white');
Browser.deleteRoute(red,'touchTime',me,'bar_red');
Browser.deleteRoute(blue,'touchTime',me,'bar_blue');
}
function dlp(value) {
if (value == 1) {
index_switch.whichChoice = -1;
dlp_switch.whichChoice = 0;
} else if (value == 0) {
index_switch.whichChoice = 0;
dlp_switch.whichChoice = -1;
}}
function bar_white(time) { slide_set.touched = 1; }
function bar_red(time) { slide_set.touched = 2; }
function bar_blue(time) { slide_set.touched = 2; }
function toggle(time) {
if (state == 0) {
xswitch.whichChoice = -1;
slide_set.hide = -1;
state = 1;
} else if (state == 1) {
xswitch.whichChoice = 0;
slide_set.hide = 0;
state = 0;
}
}
"
}
]
}
] } ## end transform
}
(C) A. Eliëns
21/5/2007
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.