|
|
VRML Script Tutorial
Full list
VRML Interactive Tutorial
Introduction
VRML File Structure
Drawing: Shape node
Geometry Nodes:
Appearance
Let there be Light
Materials with Colored Lights
Hierarchical Node Structures
Inlining Files
Defining and Instancing Nodes
Defining Levels of Detail
Events in VRML
Interpolators
Let the Music Play
Bindable Nodes
Adding Realism to the world
Information about your world
Definition for Auxiliary Nodes
|
|
|
|
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"
}
|