| Image Worlds File SpecificationAn Extension to VRML 2.0For Image-Based Virtual RealityJuly 29, 1996ゥ Copyright 1996, RealSpace, Inc. All rights reserved. Table of Contents1. Introduction2. Panoramic Images 3. Mime Type 4. Vistas 5. Creating Links Between Vistas 6. IMobs (Image-Based Objects) 7. ScreenIMobs 8. WorldIMobs 9. RealVR Traveler Scripting 1. IntroductionThis document describes an extension to the VRML 2.0 3D world description file format to allow panoramic images to be used as backgrounds. In addition, two other node types are introduced that let a VRML author describe objects with a sequence of photographic or pre-rendered images. Linking information is provided through the use of VRML scripts to allow the user to move between panoramas.The format of the Image Worlds extension is based on the VRML 2.0 file format. For a complete description of VRML 2.0, please see the VRML 2.0 specification itself. Three new node types are introduced: Vista, ScreenIMob, and WorldIMob. 2. Panoramic ImagesPanoramic images are at the heart of the Image Worlds VRML extension. With panoramic images, a scene author can create a rich environment that using photographs, synthetic images, or a combination of both, without using a single polygon. Panoramas in Image Worlds currently come in three varieties: cylindrical, spherical, or cubic. They can be thought of as "unwrapped" cylinders, spheres, and cubes, respectively. Samples of each are shown below:
 3. Mime TypeThe mime type for VRML files with the Image Worlds extension is "i-world/i-vrml" and the file extension is ".ivr".4. VistaA Vista defines an image panorama which the user views by standing in its center and pivoting the view direction. Typically, several Vistas will be arranged in a VRML Switch group along with some script nodes so that the user can "jump" between Vistas by switching one Vista off and another Vista on.The Vista node declares which panoramic image to use and the viewing characteristics of the panorama. Vistas also behave similarly to VRML groups. That is, they contain "children" nodes that are associated with that panorama. One can think of the children as being visible only from their parent Vista. FILE FORMAT/DEFAULTS 
Vista {
    field           SFString    type        "SPHERE"
    field           MFString    filename    []
    exposedField    SFVec3f     position    0 0 0
    field           SFVec2f     vFov        -1.5708 1.5708 # -90 to 90 degrees
    field           SFVec2f     hFov        0 0
    exposedField    SFVec2f     pitchRange  -1.5708 1.5708 # -90 to 90 degrees
    exposedField    SFVec2f     yawRange    0 0
    exposedField    SFVec2f     zoomRange   0 1.5708       # 0 to 90 degrees
    exposedField    SFColor     backColor   0 0 0
    field           SFString    description ""
    field           SFString    copyright   ""
    exposedField    MFNode      children    []
    eventOut        SFVec2f     clickPt
    eventOut        SFVec2f     overPt
}
Each of the Vista fields is described below: 
 Choices for 'type' field: 
 5. Creating "Links" Between VistasMultiple Vistas are commonly used together in order to "model" a larger, more complex space. For example, each room in a house might be represented by a Vista node. Because Image Worlds is an extension to standard VRML, Vistas may be included in a file however the author chooses. However, the most common method for letting the user navigate between multiple Vistas is to use a Switch node.There are two steps to setting up a multiple Vista world. First, all the Vistas are arranged inside a Switch group. Second, Script nodes are set up to allow the user to navigate from one node to another. Placing several Vista nodes in a Switch would look something like this: 
#VRML V2.0 utf8
DEF VistaSwitch Switch {
    whichChoice 0
    choice [
        DEF Node1 Vista {
            # fill in vista fields here...
        },
        DEF Node2 Vista {
            # fill in vista fields here...
        }
    ]
}
In the sample above, the world contains two Vistas, Node1 and Node2. When the file is opened, the user sees Node1 because the Switch node's whichChoice field points to that Vista. To jump to Node2, the whichChoice field of the Switch node needs to be changed to the value 1. This is accomplished by using VRML Script nodes. The RealVR Traveler has a built-in mechanism for creating such scripts. No Java or VRML Script programming is necessary. To make use of this built-in script, add a Script node to the VRML scene with a url of "rst:link". This tells the RealVR Traveler to use its built-in linking script. To make use of this script, route an SFVec2f value to the clickPt eventIn of this script. For jumping between Vistas, one typically routes the clickPt eventOut of a Vista to the clickPt eventIn of this script. Next, a value_changed eventOut will be generated from this script if the user made a "legal" click. The contents of value_changed comes from the outValue field of the script, and is typically of type SFInt32 and is routed back to the switch node to change the current Vista. (If this seems confusing, a quick peek at a samplecouldn't hurt.) LINK SCRIPT FORMAT 
Script {
    # a field common to all VRML script nodes:
    exposedField MFString url        "rst:link"
    # events specific to the "link" type Script:
    eventIn      SFVec2f  clickPt
    eventIn      SFVec2f  overPt
    eventOut     SFBool   goodClick
    eventOut     SFBool   goodOver
    eventOut     SFInt32  value_changed
    # fields specific to the "link" type Script:
    field        SFVec2f  xBounds    0 1
    field        SFVec2f  yBounds    0 1
    field        SFInt32  outValue   -1
    field        SFString cursor     "LINK"
    field        SFString transition "CUT"
    field        SFVec3f  viewDir    0 0 0
    field        SFFloat  zoomAngle  0
    field        SFString toURL      ""
    field        SFString toFrame    ""
    field        SFString toSwitch   ""
    field        SFInt32  switchTo   0
}
The fields of this script are described below: 
 Sample FileBelow is a sample file with two Vistas set up so the user can jump back and forth between them:
#VRML V2.0 utf8
DEF VistaSwitch Switch {
    whichChoice 0
    choice [
        DEF Node1 Vista {
            type "SPHERE"
            filename "node1.jpg"
            position 0 0 0
        },
        DEF Node2 Vista {
            type "CYLINDER"
            filename "node2.jpg"
            position 0 0 -30
            vFov -0.7418 0.7418
            pitchRange -0.7418 0.7418
        }
    ]
}
DEF Link12 Script {
    url "rst:link"
    eventIn SFVec2f clickPt
    eventIn SFVec2f overPt
    eventOut SFInt32 value_changed
    field SFInt32 outValue 1
    field SFVec2f xBounds 0.429 0.573
    field SFVec2f yBounds 0.434 0.653
    field SFString transition "ZOOM"
    field SFVec3f viewDir 0 3.1416 0
    field SFFloat zoomAngle 0.2
}
DEF Link21 Script {
    url "rst:link"
    eventIn SFVec2f clickPt
    eventIn SFVec2f overPt
    eventOut SFInt32 value_changed
    field SFInt32 outValue 0
    field SFVec2f xBounds 0.2 0.1
    field SFVec2f yBounds 0.434 0.653
    field SFString transition "ZOOM"
    field SFVec3f viewDir 0 0 0
    field SFFloat zoomAngle 0.2
}
ROUTE Node1.clickPt TO Link12.clickPt
ROUTE Node1.overPt TO Link12.overPt
ROUTE Link12.value_changed TO VistaSwitch.set_whichChoice
ROUTE Node2.clickPt TO Link21.clickPt
ROUTE Node2.overPt TO Link21.overPt
ROUTE Link21.value_changed TO VistaSwitch.set_whichChoice
6. IMobsIMobs, or Image-Based Objects, are another feature of the Image Worlds extension. Polygons are useful for defining simple 3D geometric objects, but to get the complete detail of a real-world object, photographs or high-quality computer renderings can be used for a more realistic appearance. An IMob is a collection of images of a 3D object, taken from various angles around the object. During playback, the user can manipulate the IMob, and by changing which image is displayed, it seems to the user as if an actual 3D object is being examined. IMobs can be used anywhere in a VRML file that a standard VRML Shape node might be used. IMobs currently come in two varieties: ScreenIMobs and WorldIMobs, each described below: 7. ScreenIMobsA ScreenIMob is an image-based object that is displayed directly in the browser window, not in 3D space. That is, if the user looks in another direction, a ScreenIMob stays in the same position in the window. They are good for user interface widgets, and for examining objects in the scene. FILE FORMAT/DEFAULTS 
ScreenIMob {
    field           SFString    type         "PICT"
    field           MFString    filename     []
    field           SFString    alignment    "CENTER"
    exposedField    SFInt32     width        0
    exposedField    SFInt32     height       0
    exposedField    SFFloat     opacity      1
    exposedField    SFColor     blueScreen   []
    field           MFInt32     quantization []
    exposedField    MFFloat     range        []
    exposedField    MFFloat     defaultView  []
    exposedField    MFTime      animRate     []
    exposedField    MFInt32     texCoords    []
    eventOut        SFVec2f     clickPt
    eventOut        SFVec2f     overPt
    eventOut        SFBool      goodClick
    eventOut        SFBool      goodOver
}
Each of the ScreenIMob fields is described below: 
 Choices for 'type' field: 
 8. WorldIMobsWorldIMobs are very similar to ScreenIMobs. Similar concepts are involved, such as quantization dimensions and sample ranges. However, WorldIMobs are displayed in 3D perspective, as opposed to ScreenIMob's window alignment. FILE FORMAT/DEFAULTS 
WorldIMob {
    field           SFString    type         "PICT"
    field           MFString    filename     []
    exposedField    SFFloat     width        0
    exposedField    SFFloat     height       0
    exposedField    SFFloat     opacity      1
    exposedField    SFColor     blueScreen   []
    field           MFInt32     quantization []
    exposedField    MFFloat     range        []
    exposedField    MFFloat     defaultView  []
    exposedField    MFTime      animRate     []
    eventOut        SFVec2f     clickPt
    eventOut        SFVec2f     overPt
    eventOut        SFBool      goodClick
    eventOut        SFBool      goodOver
}
Each of the ScreenIMob fields is described below: 
 9. RealVR Traveler ScriptingThe RealVR Traveler has support for several simple behaviors implemented as built-in scripts. One of these is the Link script described above. The other built-in scripts are described here. |