LectureTopicsDay2

advertisement
Virtools Training
Sept 7, 2005
1) Coordinate Systems
2) Introduction to Virtools
3) Review Exercises from Monday
1) Coordinate Systems
The DiVE coordinates are measured in meters. The origin is the center of the floor.
Even though it might look small in the Virtools window, be sure to pay attention to
the “world size” of an object. The values are meters.
Virtools uses a left-handed coordinate system. In world coordinates, “Y” is up, “X”
is screen left, and we generally look down the positive “Z” axis.
Each object has it’s own coordinate system. You can see the position and orientation
of an object in world coordinates by looking at the “3D Object Setup” window.
Notice that scaling an object relative to its local size changes the objects “world size”.
Once you have an object scaled to the right size for your application, choose the “set
as unit” button. This will adjust the coordinates of an object’s vertices to reflect it’s
new size.
2) Introduction to Virtools
File types and example locations
A Virtools composition is contained in a ‘.cmo’ file.
A Virtools object is contained in a ‘.nmo’ file.
A Virtools script is contained in a ‘.nms’ file.
When you publish a virtual world into a playable executable, a ‘.vmo’ file is created.
Virtools ships with many example compositions. Look in
C:\Program Files\Virtools\Virtools Dev 3.0\Documentation\CMOS
The folder BBSamples have the *.cmo files that are examples for each building
block.
Other examples are in the Documentation folder.
Virtools Resources
All worlds are built with objects and building blocks. A basic set of objects are
available under the “VirtoolsResources” tab on the upper left window. Building
blocks are modules for adding behaviors to objects. The behaviors are built by
creating a script on an object and linking building blocks together.
Objects
Each object contains a mesh. Each mesh contains a material. Each material can use a
texture. A mesh is the set of vertices and edges that define the geometry of an object.
A material defines the color of an object and how light reflects off the object. A
texture is like wallpaper, or a decal. Many special effects can be created using
textures. Note that transparency is set with the material, not the texture. Several
objects can share the same texture image and material. Notice that when you “delete”
an object, it asks how to handle dependencies of that object. In the beginning, delete
with “full dependencies”. Later we will learn how to share textures and materials; in
that case we must be more careful on how we delete objects.
TIP If you select the F2 key either on the name field in “Object setup” or after
selecting an object in the Level Manager, then you can rename that object. Scenes
get confusing very quickly if your object names are “cube” “cube 1” “cube 2”
Initial Conditions of Objects
It is sometimes necessary to set initial conditions on objects; particularly if they have
built in motion. But be warned – sometimes an object will not behave as you’d
expect because an initial condition was set. This is particularly problematic when
using hierarchies to move objects; or it is common to forget that an initial condition
was set and lose some manipulation that happened in the 3D Layout window.
Attributes of Objects
Building blocks, such as “constrain on floor,” look to see if an object has the attribute
“floor” to see if it’s a floor.
Building Blocks
Building blocks must be added to a script – that’s attached to an object. You can drag
a building block down to a script or TIP <ctl> double left click – brings up a
searchable dialogue box for building blocks. If you select a BB and hit the F1 key,
the manual page for that building block will appear. Notice the examples on each BB
web page.
Some building blocks have an internal, continual loop. Some execute once. A hint
for understanding this issue is weather a BB has a start/stop input/output. More on
BB’s, parameters, and flow control later.
3D Layout Viewer
By default, we look at the existing virtual world through a built-in “perspective view”
camera. This is only available in authoring mode. It is a common mistake to publish
a Virtools world to a web viewer without including an exportable camera. The icons
in the 3D Layout Viewer are:
Upper Left – picker and object movement
Middle Left – reference guides. These toggle buttons let you see 3D depth better.
Lower Middle Left – creation of cameras, lights, frames, paths, grids, 2D frames,
materials, textures, and portals. Each of these items are worthy of discussion.
Lowest Left – Camera manipulation buttons. Notice that you are manipulating
whichever camera is currently active. Look along the window top to see current
active camera. Cameras created explicitly can also be manipulated as objects. Ditto
with lights. Note – you can have at most 8 active lights in a Direct X composition.
TIP camera manipulations have many shortcuts. Go to the 3D Layout Shortcuts page
in the on-line manual to see these key shortcuts.
Top Window Bar
Middle – active viewing camera
Right – “General Preferences” – this dialogue box lets you select what you see in
“author mode” of the 3D layout window; and what you see in “play” mode.
Wireframes, cameras, and lights are sometimes important to see during play mode.
Playing A Composition – Frame Rate vs. Clock Rate and Tracing
In the lower left corner of the full Virtools environment, notice the VCR buttons and
error log locations. Right click on the VCR buttons to adjust frame rate.
In the “Schematic” window you can see what module is active in play mode if
“Trace” is turned on. TIP Sometimes building blocks are visible in a script, but are
not instantiated in Virtools. When this happens, the building block will be a darker
grey color. Selecting the IC button on the VCR button will solve this problem. It is a
good habit to just hit the IC button regularly while creating and testing a composition.
Working With a Script
Each building block has control input/output and parameter settings. Parameters can
be watched in a script through the use of shortcuts. See exercise 3 for hints on how to
do this. You can also display variables and parameters to the screen in “play” mode
by using the TEXT DISPLAY building block.
Download