Difference between revisions of "Virtual Calit2 Building"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(Contributors)
(General Structure)
Line 23: Line 23:
 
The entire model is saved as one Max file, then from an individual or multiple layers, smaller files are saved again for final export. Currently, the entire model is organized into these parts:
 
The entire model is saved as one Max file, then from an individual or multiple layers, smaller files are saved again for final export. Currently, the entire model is organized into these parts:
  
- A loader to run the model and allows turning on and off layers to allow for maximum speed; manual VRML script.
+
* A loader to run the model and allows turning on and off layers to allow for maximum speed; manual VRML script.
  
- Main model, this is the exterior of the building and miscellaneous parts; this inlines inlineDoorAnimated.wrl, inlineElevInit.wrl, and inlineLightSwitScript.wrl for corresponding dynamic effects.
+
* Main model, this is the exterior of the building and miscellaneous parts; this inlines inlineDoorAnimated.wrl, inlineElevInit.wrl, and inlineLightSwitScript.wrl for corresponding dynamic effects.
  
- Floor 1 in the main building and furnitures; exported directly from 3ds Max file's corresponding layers.
+
* Floor 1 in the main building and furnitures; exported directly from 3ds Max file's corresponding layers.
  
- Floor 1 New Media Arts Wing rooms; exported directly from 3ds Max file's corresponding layers.
+
* Floor 1 New Media Arts Wing rooms; exported directly from 3ds Max file's corresponding layers.
  
- Floor 2; exported directly from 3ds Max file's corresponding layers.
+
* Floor 2; exported directly from 3ds Max file's corresponding layers.
  
- Floor 3; exported directly from 3ds Max file's corresponding layers.
+
* Floor 3; exported directly from 3ds Max file's corresponding layers.
  
- Floor 4; exported directly from 3ds Max file's corresponding layers.
+
* Floor 4; exported directly from 3ds Max file's corresponding layers.
  
- Floor 5; exported directly from 3ds Max file's corresponding layers.
+
* Floor 5; exported directly from 3ds Max file's corresponding layers.
  
- Floor 6; exported directly from 3ds Max file's corresponding layers.
+
* Floor 6; exported directly from 3ds Max file's corresponding layers.
  
- All animated doors; this file contains only those doors that are animated; physical door objects are exported directly from 3ds Max, partial VRML code is added from modifying exported code.
+
* All animated doors; this file contains only those doors that are animated; physical door objects are exported directly from 3ds Max, partial VRML code is added from modifying exported code.
  
- Elevator initializer; initialize and create 3 elevators from a script PROTOtype (see below); mostly manual VRML script.
+
* Elevator initializer; initialize and create 3 elevators from a script PROTOtype (see below); mostly manual VRML script.
  
- Elevator prototype; include code for 1 set of elevator's movement, audio, and other operations; the initializer creates 3 copies of this prototype to create 3 independent sets of elevators; physical objects are exported directly from Max with 1 line of code changed to link to the script, core logic is done by manual VRML script with JavaScript.
+
* Elevator prototype; include code for 1 set of elevator's movement, audio, and other operations; the initializer creates 3 copies of this prototype to create 3 independent sets of elevators; physical objects are exported directly from Max with 1 line of code changed to link to the script, core logic is done by manual VRML script with JavaScript.
  
- Light switch; include code for light object's on and off controlled by 2 separate switches; physical objects are Max-exported, logic is manual VRML script with JavaScript.
+
* Light switch; include code for light object's on and off controlled by 2 separate switches; physical objects are Max-exported, logic is manual VRML script with JavaScript.
 
+
- (Elevator physical objects; not directly required for run-time, but contains elevator objects exported from Max; the entire content of this file is pasted into the Elevator prototype file in order for the logic to link to objects.)
+
 
+
- (Light switch physical objects; not directly required for run-time, but contains light objects exported from Max; the entire content of this file is pasted into the Light switch file in order for the logic to link to objects.)
+
 
+
- (A readme file prepared for future maintenance; include most, if not all, of the necessary changes that need to be made to a directly Max-exported file for all the parts to run correctly.)
+
  
 +
* (Elevator physical objects; not directly required for run-time, but contains elevator objects exported from Max; the entire content of this file is pasted into the Elevator prototype file in order for the logic to link to objects.)
  
 +
* (Light switch physical objects; not directly required for run-time, but contains light objects exported from Max; the entire content of this file is pasted into the Light switch file in order for the logic to link to objects.)
  
 +
* (A readme file prepared for future maintenance; include most, if not all, of the necessary changes that need to be made to a directly Max-exported file for all the parts to run correctly.)
  
 
==Modeling in Autodesk 3ds Max==
 
==Modeling in Autodesk 3ds Max==

Revision as of 20:36, 20 August 2008

The goal the Virtual Calit2 Building is to provide an accurate and accessible virtual replica of the Calit2 building that can be used by any researcher or scientist to conduct projects or tests that require the need for a detailed architectural layout.

Contents

Proposed Projects Using the Virtual Calit2 Building

Michael Bajorek

In the news: Calit2 Collaborates with Architects and UC San Diego Neuroscientists to Study How 'Way-Finding' Affects the Brain

Contributors

Daniel Rohrlick continues making further additions to the existing model. The first floor of the Calit2 building is coming closer to completion.

Philip Weber provided excellent assistance with model loading techniques.

Vinh Huynh.

Mabel Zhang is adding the first set of interactive dynamic elements to make the model more realistic.

General Structure

As dynamic elements were added, a more object-oriented structure is needed to maintain the model files.

The entire model is saved as one Max file, then from an individual or multiple layers, smaller files are saved again for final export. Currently, the entire model is organized into these parts:

  • A loader to run the model and allows turning on and off layers to allow for maximum speed; manual VRML script.
  • Main model, this is the exterior of the building and miscellaneous parts; this inlines inlineDoorAnimated.wrl, inlineElevInit.wrl, and inlineLightSwitScript.wrl for corresponding dynamic effects.
  • Floor 1 in the main building and furnitures; exported directly from 3ds Max file's corresponding layers.
  • Floor 1 New Media Arts Wing rooms; exported directly from 3ds Max file's corresponding layers.
  • Floor 2; exported directly from 3ds Max file's corresponding layers.
  • Floor 3; exported directly from 3ds Max file's corresponding layers.
  • Floor 4; exported directly from 3ds Max file's corresponding layers.
  • Floor 5; exported directly from 3ds Max file's corresponding layers.
  • Floor 6; exported directly from 3ds Max file's corresponding layers.
  • All animated doors; this file contains only those doors that are animated; physical door objects are exported directly from 3ds Max, partial VRML code is added from modifying exported code.
  • Elevator initializer; initialize and create 3 elevators from a script PROTOtype (see below); mostly manual VRML script.
  • Elevator prototype; include code for 1 set of elevator's movement, audio, and other operations; the initializer creates 3 copies of this prototype to create 3 independent sets of elevators; physical objects are exported directly from Max with 1 line of code changed to link to the script, core logic is done by manual VRML script with JavaScript.
  • Light switch; include code for light object's on and off controlled by 2 separate switches; physical objects are Max-exported, logic is manual VRML script with JavaScript.
  • (Elevator physical objects; not directly required for run-time, but contains elevator objects exported from Max; the entire content of this file is pasted into the Elevator prototype file in order for the logic to link to objects.)
  • (Light switch physical objects; not directly required for run-time, but contains light objects exported from Max; the entire content of this file is pasted into the Light switch file in order for the logic to link to objects.)
  • (A readme file prepared for future maintenance; include most, if not all, of the necessary changes that need to be made to a directly Max-exported file for all the parts to run correctly.)

Modeling in Autodesk 3ds Max

Modeling in preparation for VRML export

Because the final version of the model is in VRML format, during the modeling process in 3ds Max, the most important thing to keep in mind is that not all effects will export to VRML. 3ds Max comes with a detailed user reference that includes some useful tips and exporting rules on VRML. Not all materials are exported, not all lights are exported, different geometry types export to files of significantly different sizes, etc.

Post-exporting

From many websites focusing on projects using 3ds Max + VRML, it is suggested that the Max-exported VRML file should be checked and edited manually for the final version. For a static model, this is quite simple; the most often hand operation would probably be commenting out automatically generated looping timers and interpolations, which will continuously generate polygons during run-time. However, for a model with logic scripts, the exported code must be combined with the manual script into a single file for the effect to work; simply inlining the exported object file or the script will not suffice, because VRML requires that the script and the objects be in the same file for the linking to take effect, otherwise syntax errors will result. This means that either the exported file contents will need to be pasted into the script file, or vise versa, so a clear structure and documentation is even more important.


....more to come

Dynamic Elements

Automatic Doors

....more to come


Working Elevators

....more to come

A drawback of the current approach is that it cannot simulate the exact logic of the elevators in the real building. The virtual elevators currently operate independently, while the real ones are dependent. For example, in reality, there are 2 sets of buttons to call the elevator, and when a user calls the elevator from a floor, whichever elevator cab that is the most "convenient" will come to the user; in the virtual building, there are 3 sets of call buttons, and each elevator responds only to the set of buttons linked to it, meaning that the user controls whichever elevator will come by pressing on the corresponding set of buttons. We took the current approach because it involves less logic and linking and is less time-consuming; it only requires 1 set of definitions that can be initialized 3 times to generate 3 elevators. However, simulating the realistic logic will make the model more intelligent and believable.


Light Effects

....more to come


VRML Scripting + JavaScript in General

....more to come

Optimization

The difference between a very nicely and smoothly rendered architectural scene and a real-time 3D model is that the former allows for rendering ahead of the time, and the latter requires rendering on the fly. Because of this, in order to reach the maximum navigation speed in the architectural model, some details need to be sacrificed; this includes the smoothness of surfaces, details in objects, resolution of textures, etc. The VRML language itself already has some features to enable fast real-time rendering such as the lack of shadows so that no shadows will need to be calculated for rendering; this is also part of the reason that VRML does not support all of the effects from 3ds Max, and the non-supported features are not exported to VRML files when using the 3ds Max exporter.

Our main approach was to reduce the polygon count, to shrink texture file size, and to reuse textures.

....more to come



Misc. Debugging Ideas and Tricky Surprises

Automatically Generated INTERPs and TIMERs

Like anything else, the 3ds Max VRML exporter is not always perfect; it sometimes generates unwanted results that needs to be manually taken care of. If there are grouped objects in a scene, after exporting the scene, open the VRML file and search for "INTERP" or "-TIMER". It is very likely that a ...-TIMER object has been automatically generated below the group name DEFinition, and its characteristic is that its definition is single-lined, its loop is TRUE, and its CycleInterval is the 3ds Max animation track bar time divided by 30 fps (if using the default track bar, 0-100 frames, then the CycleInterval will be 3.333). Along with the timer, a corresponding INTERP has been generated and is ROUTEd by the timer. These timers and interpolations are the culprit of continuously generated polygons during run-time in OpenCOVER. The solution is to simply comment out the timer's definition and the corresponding ROUTEing lines; there are usually 3 in a set. If it seems that the interpolation is not routed to by anything else, it might be harmless to delete the entire definition, since it is often many lines long; but I have not test this thoroughly as to guarentee it.



....more to come

Future Work

....more to come



More Images

Exterior1 medium.jpg

The Calit2 building viewed in wireframe mode.


Exterior1 wire medium.jpg

The Calit2 Building shown with photo-realistic textures.


Interior1 medium.jpg

A view of the interior lobby of Calit2.


....more to come