OpenGL VRML Shockwave 3D
Home Tutorials Books Applications Tools Docs Models Textures

Send me bugs and suggestions, please
VRML Script Tutorial
Full list

VRML Interactive Tutorial

Introduction
VRML File Structure
Drawing: Shape node
Geometry Nodes:
Box
Sphere
Cone
Cylinder
PointSet
IndexedLineSet
IndexedFaceSet
Extrusion
ElevationGrid
Example: Chessboard
Text
FontStyle
Appearance
Material
Textures
Image Texture
Movie Texture
Pixel Texture
Texture Coordinate
Texture Transform
Let there be Light
Directional Light
Point Light
Spot Light
Materials with Colored Lights
Hierarchical Node Structures
Group
Transform
Collision
Anchor
Billboard
Switch
Inlining Files
Defining and Instancing Nodes
Defining Levels of Detail
Events in VRML
Creating Paths between events: ROUTE
Generating Events based on Timers or User Actions
Timers
Touch Sensor
Visibility Sensor
Dragging Sensors
Plane Sensor
Sphere Sensor
Cylinder Sensor
Proximity Sensors
Example: Proximity sensor
Interpolators
Color
Coordinate
Normal
Orientation
Position
Scalar
Example
Let the Music Play
Sound
AudioClip
Bindable Nodes
Who Am I: NavigationInfo
Where Am I: ViewPoint
Adding Realism to the world
Background
Fog
Information about your world
WorldInfo
Definition for Auxiliary Nodes
Coordinate
Color
Normal

Anchor Node


If you're not familiar to grouping nodes in VRML see the section Creating Hierarchical Node Structures for general information on grouping.

The Anchor node lets you define a set of objects as a link to a url. When you click in one of the objects within an Anchor node the url will be fetched.

Anchor nodes can also be used to set a given Viewpoint. Examples will be provided bellow.

When the user has the mouse over an object contained in an Anchor node the url will be displayed.

The following fields are present:
  • children which contains all the nodes included in the group.
  • url specifies the url to be fetched or a Viewpoint to become active. You can specify multiple locations if you want to, the browser will look for data in those locations in decreasing order of preference.
  • parameter supplies additional information for the browser. For instance you can specify the target window where the url should be displayed.
  • description specifies a string which will replace the url information given to the user when the mouse is over an object contained within an Anchor.
  • bboxCenter specifies the center of a box that encloses the nodes in the group. The value for this field is a 3D point.
  • bboxSize specifies where the size of a box that encloses the nodes in the group. By default this field has a value of -1 -1 -1, which implies that no box is defined. The values for this field must be greater than or equal to zero. If the children nodes do not fit inside the box defined the results are undefined.
  • The latter two fields are optional. They can be used by the browser for optimization purposes.



    Syntax:
    Anchor {
    children [ ]
    url [ ]
    parameter
    description ""
    bboxCenter 0 0 0
    bboxSize -1 -1 -1
    }




    Example:
    Anchor {
    children [ Shape { geometry Sphere { } }]
    url "http://www.my_server.pt/my_world.wrl"
    description "My World"
    parameter ["target=my_frame" ]
    }


    In the above example when the mouse is over an object contained in the Anchor node a prompt will be displayed with the message "My World" (If description was absent the prompt would display the url specified). When the user clicks an object contained in the Anchor node the specified url is fetched and displayed in the frame named "my_frame".

    The next example shows an Anchor which is linked to a Viewpoint. When the mouse is over an object contained in the Anchor node a prompt will be displayed with the message "My Point of View". When the user clicks an object contained in the Anchor node the specified Viewpoint becomes active.

    Example:
    Anchor {
    children [ Shape { geometry Sphere { } } ]
    url #my_viewpoint
    description "My Point of View"
    }




    Site designed and maintained by António Ramires Fernandes
    Your comments, suggestions and references to further material are welcome!

    Lighthouse 3D privacy statement