media @ VU
proto-bulb.vr
proto-bulb.vr
(wrl
)
[ flux /
bitmanagement /
cortona /
octaga
]
Web3D/VR
a (speech) bulb
#@include @vr/extern/blaxxun/NurbsSurface.wrl
extern monitor
EXTERNPROTO monitor {
eventIn MFString message
exposedField MFString string
exposedField SFVec3f scale
exposedField SFVec3f translation
exposedField SFRotation rotation
exposedField SFColor text
eventOut MFString message_changed
][ "@vr-proto-monitor.wrl" ]
bulb proto
PROTO bulb [ ## "@vr-extern-bulb.wrl"
eventIn MFString message
exposedField MFString string []
exposedField SFVec3f translation 0 0 0
exposedField SFRotation rotation 0 0 1 0
exposedField SFVec3f scale 1 1 1
exposedField SFInt32 type 0
exposedField SFColor color 1 1 0
exposedField SFColor text 1 1 1
exposedField SFFloat transparency 0.7
exposedField SFVec3f text_scale 1 1 1
exposedField SFVec3f text_translation 0 0 0
exposedField SFRotation text_rotation 0 0 1 0
exposedField MFString background []
eventOut MFString message_changed
]{
body
Billboard {
children [
Transform {
rotation IS rotation
translation IS translation
scale IS scale
children [
Switch {
whichChoice IS type
choice [
right 0
Transform {
translation 3 2 0
scale 0.4 0.4 1
children [
Transform {
translation -4 0.5 0
children [
DEF TEXT monitor {
rotation IS text_rotation
translation IS text_translation
scale IS text_scale
string IS string
message IS message
message_changed IS message_changed
text IS text
}
] } ## local text transform
Transform {
rotation 0 1 0 3.14 ## some trick was needed
children [
Shape {
the nurb surface
geometry DEF surface NurbsSurface {
uOrder 4
vOrder 3
uDimension 7
vDimension 3
uTessellation 100 ## needed
vTessellation 60
controlPoint [
0.3 0 0, 0.5 3.5 0, 2 4 0, 3 4.2 0, 4 2.5 0, 5 0.5 0, 5.5 -5 0,
0.3 0 0, 0.5 0 0, 2 0 0, 3 0 0, 4 0 0, 5 -2 0, 5.5 -5 0,
0.3 0 0, 0.5 -3.5 0, 2 -4 0, 3 -4.2 0, 4 -3.0 0, 5 -0.5 0, 5.5 -5 0,
]
}
appearance
appearance DEF MAT Appearance {
material Material {
diffuseColor IS color
transparency IS transparency
} # Blue
texture MovieTexture { url IS background }
}
} ## end shape
] } ##local transform
] } ## end 0 (right)
left 1
Transform {
translation -1 2 0
scale 0.4 0.4 1
children [
Transform { translation -4 0.5 0 children [ USE TEXT ]}
Transform {
rotation 0 1 0 3.14 ## some trick was needed
children [
Shape {
the nurb surface
geometry DEF surface NurbsSurface {
uOrder 4
vOrder 3
uDimension 7
vDimension 3
uTessellation 100 ## needed
vTessellation 60
controlPoint [
0.5 -5 0, 1 0.5 0, 2 2.5 0, 3 4.2 0, 4 4 0, 5.2 3.5 0, 5.3 0 0,
0.5 -5 0, 1 -2 0, 2 0 0, 3 0 0, 4 0 0, 5.2 0 0, 5.3 0 0,
0.5 -5 0, 1 -0.5 0, 2 -3.0 0, 3 -4.2 0, 4 -4.0 0, 5.2 -3.5 0, 5.3 0 0,
]
}
appearance USE MAT
} ## end shape
] } ##local transform
] } ## end 1 (left)
] } ## end switch
] }
] } ## end billboard
} ## end bulb proto
instances
Group {
children [
Inline { url "@vr-box.wrl" }
bulb {
scale 2 1 1
rotation 0 1 0 0.3
text 0 1 1 string [ "how" "are" "you?" ]
text_rotation 0 1 0 -0.3
}
bulb {
type 1
text 1 1 0
string [ "fine" "thank" "you" "..."]
text_scale 1.1 1.1 1
}
]}
scene
NavigationInfo { type ["WALK","ANY"] }
DEF v1 Viewpoint { position 0 0 10 }
(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.