Overview
Developing Virtual Environment Sets from Stock Object Libraries
One of the best approaches to solving large and complex problems is to break them up into sets of smaller and more manageable problems. This is often known as the divide and conquer approach. Building a virtual environment for any but the very simplest of uses is normally a large and complex problem. Building all of the parts of a virtual environment "from scratch" just adds to the complexity of the problem, as well as adding significantly to the time and human-resource requirements for a project.
Many projects can be completed more rapidly and cheaper by re-using pre-existing libraries of virtual objects, like those in the vrmLab Warehouse. Objects from libraries may be used "as is", or they may be modified like using a template.
Details of the Week: Repeating Textures and Object Transperancy
Using repeatS & repeatT
Note how repeatS and repeatT can be used in combination with the scale attribute of the Texture node.
<?xml version="1.0" encoding="UTF-8"?>
<World xmlns="http://www.xvrml.net/schemas/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xvrml.net/schemas/core
http://www.xvrml.net/schemas/xVRML.xsd">
<children>
<Transform translation="-4.0 -0.05 0.0">
<children>
<Shape>
<appearance>
<Texture scale="2.0 2.0">
<ImageTexture repeatS="true" repeatT="true" imageUrl="./redTile.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 0.1 2.0"/>
</geometry>
</Shape>
<Transform translation="0.0 1.0 -1.0">
<children>
<Shape>
<appearance>
<Texture>
<ImageTexture imageUrl="./repeatSandT.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 2.0 0.1"/>
</geometry>
</Shape>
</children>
</Transform>
</children>
</Transform>
<Transform translation="-1.5 -0.05 0.0">
<children>
<Shape>
<appearance>
<Texture scale="2.0 1.0">
<ImageTexture repeatS="true" imageUrl="./redTile.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 0.1 2.0"/>
</geometry>
</Shape>
<Transform translation="0.0 1.0 -1.0">
<children>
<Shape>
<appearance>
<Texture>
<ImageTexture imageUrl="./repeatS.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 2.0 0.1"/>
</geometry>
</Shape>
</children>
</Transform>
</children>
</Transform>
<Transform translation="1.0 -0.05 0.0">
<children>
<Shape>
<appearance>
<Texture scale="1.0 2.0">
<ImageTexture repeatT="true" imageUrl="./redTile.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 0.1 2.0"/>
</geometry>
</Shape>
<Transform translation="0.0 1.0 -1.0">
<children>
<Shape>
<appearance>
<Texture>
<ImageTexture imageUrl="./repeatT.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 2.0 0.1"/>
</geometry>
</Shape>
</children>
</Transform>
</children>
</Transform>
<Transform translation="3.5 -0.05 0.0">
<children>
<Shape>
<appearance>
<Texture>
<ImageTexture imageUrl="./redTile.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 0.1 2.0"/>
</geometry>
</Shape>
<Transform translation="0.0 1.0 -1.0">
<children>
<Shape>
<appearance>
<Texture>
<ImageTexture imageUrl="./none.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 2.0 0.1"/>
</geometry>
</Shape>
</children>
</Transform>
</children>
</Transform>
<Transform translation="6.0 -0.05 0.0">
<children>
<Shape>
<appearance>
<Texture scale="5.0 2.0">
<ImageTexture repeatS="true" repeatT="true" imageUrl="./redTile.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 0.1 2.0"/>
</geometry>
</Shape>
<Transform translation="0.0 1.0 -1.0">
<children>
<Shape>
<appearance>
<Texture>
<ImageTexture imageUrl="./repeatSandT.gif"/>
</Texture>
</appearance>
<geometry>
<Box size="2.0 2.0 0.1"/>
</geometry>
</Shape>
</children>
</Transform>
</children>
</Transform>
</children>
</World>
Using Transparent Materials
Transparent window/wall example
Note how the alpha attribute can be used in a Material color node. What happens with a one-sided oject?
<?xml version="1.0" encoding="UTF-8"?>
<World xmlns="http://www.xvrml.net/schemas/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xvrml.net/schemas/core
http://www.xvrml.net/schemas/xVRML.xsd">
<children>
<Viewpoint name="first" position="0.0 0.0 20.0"/>
<Viewpoint name="second" position="-20.0 0.0 0.0" rotation="0.0 -1.0 0.0 1.57"/>
<Transform translation="0.0 0.0 -2.0">
<children>
<Shape name="baseSphere">
<appearance>
<Material>
<diffuseColor red="0.0" green="1.0" blue="1.0"/>
</Material>
</appearance>
<geometry>
<Sphere/>
</geometry>
</Shape>
</children>
</Transform>
<Transform translation="10.0 0.0 0.0">
<children>
<Use target="baseSphere"/>
</children>
</Transform>
<Transform translation="0.0 0.0 5.0">
<children>
<Shape name="baseWindow">
<appearance>
<Material>
<diffuseColor red="1.0" green="1.0" blue="0.0" alpha="0.4"/>
</Material>
</appearance>
<geometry>
<Box size="10.0 10.0 0.1"/>
</geometry>
</Shape>
</children>
</Transform>
<Transform translation="5.0 0.0 0.0" rotation="0.0 1.0 0.0 1.57">
<children>
<Use target="baseWindow"/>
</children>
</Transform>
</children>
</World>
Using the vrmLab Object Warehouse
Some vrmLab Warehouse History
I set up a virtual space I called the vrmLab in 1995, as a "virtual space for VR[...] experiments and demonstrations" on the Web. That site included the vrmLab Warehouse, which I established to serve as a public repository of open-source and shared VR objects. I have converted most of those objects to the newer xVRML format.
How to Use the vrmLab Warehouse?
Your machine and Web browser can be set up to understand that the MIME type model/xvrml+xml should be associated with the Carina application. If you do that, then clicking on a model in the Warehouse directory display in your Web browser will result in that model opening in Carina. If you drag-and-drop a model from that display onto Carina, then that should also result in the model opening in Carina. Carina understands that the MIME type model/xvrml+xml is associated with xVRML files. Carina that the filename extentions which are associated with xVRML (and that MIME type) are .xwrl (for normal text files) and .xwrlz (for gzipped text files). You can also open models from your local directory display by dragging-and-dropping the models onto Carina.
How to submit objects to the vrmLab Warehouse?
Contact your instructor, please. The Warehouse accepts valid and well-formed models in xVRML format for inclusion under the Creative Commons licenses.
Carina Browser Application
Current Carina Implementation Limitations
The Carina viewer application is not yet complete. It currently supports a majority of the specification, but not all. You should use the chart on the Carina xVRML Support page to plan which nodes and what attributes to use. Note that most of the static nodes are completed, and that we have just started to implement the dynamic nodes. As of 22 MAR 2006, the following nodes and atributes are supported by Carina:
| Node | Supported | Supported Attributes | Notes |
|---|---|---|---|
| Anchor | X | All | |
| AudioClip | |||
| Avatar | X | speed, cameraOffset, bboxCenter, bboxSize | |
| Background | |||
| Billboard | |||
| Box | X | All | |
| Collision | |||
| ColorInterpolator | |||
| Cone | X | All | |
| CoordinateInterpolator | |||
| Cylinder | X | All | |
| CylinderSensor | |||
| DirectionalLight | X | All | |
| ElevationGrid | |||
| Extrusion | |||
| Fog | |||
| Group | X | All | |
| ImageTexture | X | All | |
| IndexedFaceSet | X | All | |
| IndexedLineSet | X | All | |
| Inline | X | All | |
| LOD | |||
| Material | X | All | Alpha of material colors is currently broken |
| MovieTexture | |||
| NormalInterpolator | |||
| OrientationInterpolator | |||
| PixelTexture | X | All | Transparency does not work when using 2 or 4 components |
| PlaneSensor | |||
| PointLight | X | All but radius | |
| PointSet | X | All | |
| PositionInterpolator | |||
| ProximitySensor | |||
| Route | |||
| ScalarInterpolator | |||
| Script | |||
| Shape | X | All | |
| Sound | |||
| Sphere | X | All | |
| SphereSensor | |||
| SpotLight | X | All but radius | |
| Switch | |||
| Text | |||
| Texture | X | All | Does not support MovieTexture Nodes |
| TimeSensor | |||
| TouchSensor | |||
| Transform | X | All | |
| Use | X | All | |
| Viewpoint | X | rotation, position, description, fieldOfView | |
| VisibilitySensor | |||
| World | X | All | |
| WorldInfo | X | All |
In-Class Exercise
Developing a Virtual Environment Set from a Stock Object Library
Plan and Design
Pair up with someone in the class. Look at the objects in the vrmLab Warehouse and get familiar with how they are grouped and what is available there. I will select one team-of-two to build/locate and assemble infrastructure objects, like stairwells and hallway lighting and vending machines and so on.
Design on paper a floor of an office building consisting of identical offices lining both sides of a hallway or set of hallways. Be sure to map out where all the floors and ceilings and walls and doors and lighting fixures and stairs and so on should go. Show your design to the instructor for an okay. The outside dimensions of your plan for your office building floor should be exactly 80 meters wide by 80 meters deep by 4 meters tall.
Be sure to build the corner offices as easily-replaceable groups. We are going to stack these floors up together to form a building when we are done. All groups will have to negotiate with the infrastructure group about such things as where the stairs should go and the details of the hallways.
Readings
Synthetic Environments
- Dartmouth paper on Synthetic Environments for Emergency Response
- Oregon State University paper covering virtual reality history overview
- National Center for Supercomputing Architecture paper giving A Brief History of VR