Making Head UP Displays in VRML
Introduction
Head Up Displays usually called HUDs are a simple collection of nodes which ensure that objects will remain in the same position relative to the user regardless of the movement or rotation
Examples and code
Basic HUD workings
# ProximitySensor to ensure the HUD geometry moves with the user
# used in all HUD systems
DEF GlobalProx ProximitySensor {
size 1000 1000 1000
}
DEF HUD Transform {
children [
# collide node needed to prevent collisions with the nearby HUD geometry
# not needed if the geometry is far away (a backdrop) or just lighting
Collision {
collide FALSE
children [
#HUD geometry and/or lighting
]
}
]
}
# Route user position and orientation to HUD
ROUTE GlobalProx.position_changed TO HUD.translation
ROUTE GlobalProx.orientation_changed TO HUD.rotation
version using Blaxxun's HUD node
EXTERNALPROTO HUD
[
field SFVec3f bboxSize
field SFVec3f bboxCenter
exposedField MFNode children
eventIn MFNode addChildren
eventIn MFNode removeChildren
]
["urn:inet:blaxxun.com:node:HUD",
"http://www.blaxxun.com/vrml/protos/nodes.wrl#HUD"]
DEF HUD HUD {
children [
#HUD geometry and/or lighting
]
}
HUD implemented headlight which is a vast improvement on the standard version which lacks color, intensity contols etc.
HUD replacement headlight
HUD implemented fixed backdrop which is a background which remains the same regardless of the user's movement.
Fixed backdrop
Zip file of above
An advanced HUD with text and graphics. Controls are only visable when the mouse is other the top part of the screen.
Advanced HUD
The text display is included but is inactive.
As used in Cave scene.

Cave game
|