Rick Site Admin

Joined: 08 May 2003 Posts: 106 Location: NC, US
|
Posted: Fri Feb 09, 2007 6:48 am Post subject: FadeAnchor - Proto |
|
|
Description: Prototype that fades a scene in or out. Useful for transitioning from one scene to another.
Keywords: fade, transition, advanaced anchor
PROTO VRML: http://vrmlworld.net/no_cache/fadeanchor.wrl
Example VRML: http://vrmlworld.net/forums/examples/no_cache/fadeanchorexample.wrl
ABNet: http://vrmlworld.net/frameset.php?url=http://vrmlworld.net/forums/examples/no_cache/fadeanchorexample.wrl
VRML Example Source:
| Code: | # Desc: Example showing FadeAnchor
# Illustrates all thee modes
# Fade In, Fade Out using Proxmity, and FadeOut using Touch
#
EXTERNPROTO FadeAnchor [
field MFString url # []
field MFString parameter # []
field SFString description # ""
field MFNode children # []
field MFString hudmsg # ["loading...", "teleporting..."]
field SFFloat set_transparency # 1
field SFTime fadeInLength # 3
field SFTime fadeOutLength # 3
field SFBool initial # FALSE
# only used when initial = TRUE
field SFBool showAvatar # TRUE
field SFNode worldSwitch # NULL
field SFNode worldBackground # NULL
# only used when initial = FALSE
field SFString type # "TOUCH" or "PROXIMITY"
# only used by PROXIMITY
field SFVec3f size # 1 1 1
field SFVec3f center # 0 0 0
#
field SFBool bDebug # FALSE .. print messages to console
]
[
"fadeanchor.wrl", # try local version first
"http://vrmlworld.net/no_cache/fadeanchor.wrl"
]
Viewpoint {
position 0 1.75 12
orientation 0 1 0 0
}
DEF startBack Background {
skyColor [0 0 0]
}
DEF worldBack Background{
skyColor[0 0 .7, .45 .65 .7, .2 .2 .4 ,.1 .1 .3]
skyAngle[1.2,1.64,1.77]
}
DEF worldSwitch Switch {
whichChoice 0
choice [
Group {} # initial node
Group { # final node shown after the worlds fade in is done
children [
DEF floor Shape {
geometry Box { size 30 0.01 30 }
}
Transform {
translation -6 1 0
children
DEF FadeOutProxAnchor FadeAnchor {
type "PROXIMITY"
center 0 1 0
size 4 3 4
description "Don't get too close or you will get teleported to entry point 2..."
children [
Billboard {
children
Shape {
geometry Box { size 1 2.2 .1 }
appearance Appearance {
material Material {
diffuseColor .21 .44 0
emissiveColor .09 .18 0
ambientIntensity 0
shininess 0
}
}
}
}
]
url "http://vrmlworld.net/bag/bag.wrl#Entry_2"
bDebug TRUE
}
}
Transform {
translation 6 1 0
children
DEF FadeOutTouchAnchor FadeAnchor {
bDebug TRUE
description "Click me and get teleported to entry point 1..."
url "http://vrmlworld.net/bag/bag.wrl#Entry_1"
children [
Billboard {
children
Shape {
geometry Sphere { radius .25 }
appearance Appearance {
material Material {
diffuseColor 1 0 0
emissiveColor .2 0 0
ambientIntensity 0
shininess 0
}
}
}
}
]
}
}
]
}
]
}
DEF FadeInAnchor FadeAnchor {
fadeInLength 1
set_transparency 1.0
initial TRUE
worldSwitch USE worldSwitch
worldBackground USE worldBack
hudmsg ["rezzing...", "teleporting..."]
bDebug TRUE
} |
|
|