The VisibilityInline Node
Overview:
The VisibilityInline node is an new node for VRML, implemented using VRML's EXTERNPROTO facility. It aims to provide the same basic functionality as the built-in Inline node, but offers control over when the file to be inlined should be loaded, both statically (in the VRML code) and dynamically (via events passed into the node). This is done because the VRML97 spec (6.25) does not define when the scene for an Inline node should be loaded.Any nodes loaded by VisibilityInline can be automatically culled from the scene graph when they are not visible. Functionality is also available to unload an already inlined file. In addition, the VisibilityInline node exposes the scene graph for the inlined file so that this can be accessed by APIs such as the EAI (EAI applets can not traverse into a scene loaded with the built-in Inline node).
Specification:
Currently, the PROTO interface looks like this
PROTO VisibilityInline [ field MFString url [] eventIn MFString set_url eventOut MFString url_changed field SFBool load TRUE eventIn SFBool set_load eventIn SFBool load_changed field SFVec3f bboxCenter 0 0 0 eventIn SFVec3f set_bboxCenter eventOut SFVec3f bboxCenter_changed field SFVec3f bboxSize -1 -1 -1 eventIn SFVec3f set_bboxSize eventOut SFVec3f bboxSize_changed eventOut MFNode children ]The VisibilityInline node is a grouping node that reads its children data from a location in the World Wide Web. When its children are read and displayed is defined by the value of the load field. If the load field is set to TRUE (the default field value), then the VRML file specified by the url field is loaded immediately. If the load field is set to FALSE, then no action is taken.
If you specifiy the load field to be FALSE, then it is possible to explicitly load the URL at a later point by sending a TRUE event to the set_load eventIn of the node, e.g. via a ProximitySensor. Likewise, if you send a FALSE event to set_load, then any currently loaded world will be unloaded from the scene graph.
Whenever the bounding box specified by bboxCenter and bboxSize is entirely outwith the viewport, then any loaded nodes are removed from the scene graph (but not from memory). If you do not specify a value for bboxSize, or you set its value to -1 -1 -1, then this culling is not performed. The value of the children eventOut is not affected by the visibility culling.
An example use of this EXTERNPROTO might be:
VisibilityInline { url "test.wrl" # URL to be inlined (eventually) load FALSE # delay loading until set_load triggered }
Examples:
![]()
- Simple Example - a simple example that uses the VisibilityInline node to include a file which just contains a green cube. Click on the up arrow to send a set_load TRUE event to the VisibilityInline node, and Click on the down arrow to send an set_load FASLE event. Click Here for the VRML Source.
- EAI Inspector - an EAI applet that illustrates the traversal of the simple.wrl scene graph, looking for VisibilityInline nodes. When it finds the node, it displays the URL and prints out all of the top level nodes for the inlined file. Click Here for the Java Source.
Sources:
- VisibilityInline.wrl - this VRML file contains the definition of the PROTO to implement the VisibilityInline node. Currently the embedded Script node is implemented using both Java and JavaScript:
- VisibilityInline.java - view the Java source
- VisibilityInline.js - view the JavaScript source
Authors:
- Martin Reddy, SRI International
- Lee Iverson, SRI International
Compatibility:
The recommended viewing software for this node is: CosmoPlayer 2.1 under Windows with Netscape Communicator 4.x.This node requires Java in the Script node support and so will not work with CosmoPlayer under IRIX.