FadeAnchor - Proto

 
Post new topic   Reply to topic    VRMLWorld.net Forum Index -> ABNet::Examples
View previous topic :: View next topic  
Author Message
Rick
Site Admin


Joined: 08 May 2003
Posts: 106
Location: NC, US

PostPosted: 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
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VRMLWorld.net Forum Index -> ABNet::Examples All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum