Heads Up Display

PROTO HUD [
exposedField SFVec3f offset 0 0 -.5
exposedField SFVec3f scal 1 1 1
exposedField MFNode chile [Group {}]
]
{
Group {
children [
DEF prox ProximitySensor { center 0 0 0 size 10000 10000 10000}
DEF hud Transform {
children [
DEF offs Transform {
translation IS offset
scale IS scal
children IS chile
}
]}
]}

ROUTE prox.position_changed TO hud.set_translation
ROUTE prox.orientation_changed TO hud.set_rotation
}

Example usage:

HUD {
offset 0 -.1 -.4 # 10 centimeter in front of 'eye'
scal .1 .1 .1 # one tenth
chile Group {children [
Transform {
scale 2 1 1
children[
Shape {
appearance Appearance {
material Material {
diffuseColor 1 1 1
transparency .5
}
}
geometry IndexedFaceSet
{ solid FALSE
coord Coordinate { point [ 1 .3 0, 1 -1 0, -1 -1 0, -1 .3 0 ] }
coordIndex [ 0 1 2 3 ]
}
} ]}

DEF titlepanel Transform { translation -2 0 .01
scale .3 .3 .3
children [
panel_left { ymargin 0
tcolor 0 0 0
message ["Hello Info-Rich!"]
style "ITALIC"}

]}

DEF msgpanel Transform { translation -1.9 -.22 .01
scale .2 .2 .2
children [
panel_left { ymargin 0
tcolor 1 0 0
message [" "]}

]}

]}
}