media @ VU
[]
readme
course
preface
I
1
2
II
3
4
III
5
6
7
IV
8
9
10
V
11
12
afterthoughts
appendix
references
examples
resources
_
vr-example-live.vr
(wrl
)
[ flux /
bitmanagement /
cortona /
octaga
]
NavigationInfo {
type "Examine"
}
Background{
skyColor 0 0 0
}
PROTO spot [
exposedField SFVec3f translation 0 0 0
exposedField SFFloat transparency 0
]
{
Transform {
translation IS translation
children [
DEF TS TouchSensor {}
Shape {
appearance Appearance {
material DEF boxTrans Material {
diffuseColor 1 1 1
transparency IS transparency
}
}
geometry Box {
size 0.8 0.8 0.8
}
}
]
}
DEF trans Script {
eventIn SFBool isClicked
eventIn SFFloat transparency
eventOut SFFloat trans_changed
url "javascript:
function isClicked(value) {
if(value){
if(transparency == 1)
trans_changed = 0;
else trans_changed = 1;
}
}
"
}
ROUTE TS.isActive TO trans.isClicked
ROUTE boxTrans.transparency TO trans.transparency
ROUTE trans.trans_changed TO boxTrans.transparency
}
PROTO startbutton [
eventOut SFBool click_changed
] {
Transform {
translation 5 4 0
children[
DEF StartButton TouchSensor { }
Shape {
appearance Appearance {
material Material {
diffuseColor 0.5 0.5 0.5
transparency 0.5
}
}
geometry Box {size 0.8 0.4 0.2}
}
Transform {
translation -0.35 -0.075 0.1
children [
Shape {
appearance Appearance {
material Material { diffuseColor 1 1 1 }
}
geometry DEF button_text Text {
string "START"
fontStyle FontStyle {
size 0.25
justify "middle"
}
}
}
]
}
]
}
DEF toggle Script {
field SFBool active FALSE
eventIn SFBool isClicked
eventOut SFBool click_changed IS click_changed
eventOut MFString string_changed
url "javascript:
function isClicked(value) {
if(value)
{
if(active == false)
{
active = true;
string_changed = 'STOP';
}
else
{
active = false;
string_changed = 'START';
}
click_changed = active;
}
}
"
}
ROUTE StartButton.isActive TO toggle.isClicked
ROUTE toggle.string_changed TO button_text.string
}
DEF box00 spot { translation 0 0 0 }
DEF box01 spot { translation 1 0 0 }
DEF box02 spot { translation 2 0 0 }
DEF box03 spot { translation 3 0 0 }
DEF box04 spot { translation 4 0 0 }
DEF box10 spot { translation 0 1 0 }
DEF box11 spot { translation 1 1 0 }
DEF box12 spot { translation 2 1 0 }
DEF box13 spot { translation 3 1 0 }
DEF box14 spot { translation 4 1 0 }
DEF box20 spot { translation 0 2 0 }
DEF box21 spot { translation 1 2 0 }
DEF box22 spot { translation 2 2 0 }
DEF box23 spot { translation 3 2 0 }
DEF box24 spot { translation 4 2 0 }
DEF box30 spot { translation 0 3 0 }
DEF box31 spot { translation 1 3 0 }
DEF box32 spot { translation 2 3 0 }
DEF box33 spot { translation 3 3 0 }
DEF box34 spot { translation 4 3 0 }
DEF box40 spot { translation 0 4 0 }
DEF box41 spot { translation 1 4 0 }
DEF box42 spot { translation 2 4 0 }
DEF box43 spot { translation 3 4 0 }
DEF box44 spot { translation 4 4 0 }
DEF startbutton startbutton {}
Transform {
translation 0 5 0
children [
Shape {
appearance Appearance {
material Material {
diffuseColor 1 1 1
}
}
geometry Text {
string "The Game of Life"
fontStyle FontStyle {
size 0.6
}
}
}
]
}
<phrase dir=b turn=0 id=_ level=_ right="haven t~nI seen this~nbefore?"/>
<phrase dir=b turn=0 id=_ level=_ left="I am glad~nyou re paying~nattention!!">
<gesture dir=b id=_ level=_ right=0 pause=500/>
<gesture dir=b id=_ level=_ left=0 pause=600/>
[]
readme
course
preface
I
1
2
II
3
4
III
5
6
7
IV
8
9
10
V
11
12
afterthoughts
appendix
references
examples
resources
_
(C) A. Eliëns
9/8/2006
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.