Beruflich Dokumente
Kultur Dokumente
tutorial manual
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Contents
Part I: Getting started
5
1.1
Introduction.....................................................................................................7
1.2
How to use this manual .................................................................................8
1.3
Quest3D installation .....................................................................................10
1.4
Demonstation scenes ....................................................................................13
1.5
Quest3D User Interface ................................................................................14
1.6
Channels.........................................................................................................31
1.7
Program flow.................................................................................................49
1.8
Templates.......................................................................................................54
1.9
3D scenes........................................................................................................56
1.10
Publication .....................................................................................................61
1.11
Summary........................................................................................................68
Part II: The virtual studio
69
2.1
3D Objects ......................................................................................................70
2.2
Animation ......................................................................................................78
2.3
Object import.................................................................................................87
2.4
Surface properties .........................................................................................91
2.5
Lighting and shadows................................................................................106
2.6
Cameras........................................................................................................114
2.7
Graphic user interface ................................................................................120
2.8
Sound and music.........................................................................................125
2.9
Landscapes...................................................................................................130
2.10
Particle systems ...........................................................................................138
2.11
Character animation ...................................................................................143
Part III: Programming
153
3.1
Logic .............................................................................................................154
3.2
Math..............................................................................................................164
3.3
For Loop .......................................................................................................175
3.4
Arrays ...........................................................................................................185
3.5
Multiple channel groups ............................................................................196
3.6
Mathematical operators .............................................................................205
3.7
Pathfinding ..................................................................................................217
3.8
Finite state machine ....................................................................................224
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
1.1 Introduction
In recent years, 3D computer graphics have taken the world by storm. Hollywood
movies show off fully animated monsters and entire alien planets. Video games
offer fantastic characters to play and vast interactive worlds to explore.
Commercial and scientific presentations are often made in 3D. Even entire
training programs can take place in a virtual reality.
Though 3D computer graphics have reached a mainstream status, actually
creating them still requires much effort. Only with proper, dedicated tools is it
possible to produce convincing results in a timely manner.
Quest3D is the perfect software package for creating interactive 3D scenes.
Examples include product presentations, architectural visualisations, virtual
trainings and computer games.
Quest3D features a unique style of programming. Instead of having to write
thousands of lines of complex code, developers make use of a large set of
powerful building blocks. Both flexible and easy to use, Quest3D appeals to
designers , programmers and artists alike.
Working with Quest3D means developing in real-time: you are working directly
on the end result. No time will be lost on compiling code or rendering images.
Quest3D has a stunning set of graphics features. Large numbers of animated
people, convincing vegetation, shadows, fire and smoke effects and realistic water
can all be easily added to a scene. Advanced features include physics simulation,
pathfinding routines, database connectivity and networking support.
This book is your guide to Quest3D. It offers both theory and practical examples
in the form of step by step tutorials. After reading this manual, you should be
well on your way to creating almost any interactive 3D scene imaginable.
Welcome to the wonderful world of Quest3D!
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Parts
This book is divided into four parts.
Chapters
Chapter start with an introduction to a new subject. Next is a discussion of the
various related Quest3D channels and functionality. Finally, a step by step
tutorial is presented to give users a hands-on experience with the subject matter.
Tutorials
After Quest3D is installed, the completed scenes of every tutorial in this manual
can be found on the harddisk of your computer. By default, they are located in
the following directory:
C:\Program Files\Act-3D\Quest3D 3.0\Tutorials\
Format
The following formats have been used throughout this manual.
Q u e s t 3 D
Example:
3 . 0
T u t o r i a l
M a n u a l
Channels and templates (building blocks) that are added from the Templates
List to the program are printed in italics, with capitals for every word.
Example:
Add a Value channel to your program.
The locations of channels and templates within the Templates List are
printed as folders seperated by a backslash.
Example:
Logic \ Channel Caller
Reference Manual
As a complementary source of help to this book, the Reference Manual contains
descriptions of each of the various channels in Quest3D. It can be accessed by
pressing the F1 key while running the program.
10
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Quest3D installation
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
DirectX installation
From the Quest3D cd-rom installation menu, choose the Install DirectX 9.0
option.
Choose your operating system and language.
Confirm the installation by pressing Yes.
If you understand and accept the license agreement, press Yes.
DirectX will now be installed on your computer.
11
12
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Starting Quest3D
The Quest3D splash screen comes up. Click on it to proceed to the program.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Insert the Quest3D cd-rom into the cd-rom drive of your computer.
After a few moments, a viewer window comes up.
While examining the demonstrations, try to determine which elements are used,
and which of those you want to have in your project.
This manual helps you to create scenes like these demonstrations, and more.
13
14
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Quest3D offers a large set of powerful features. The program is divided into a
number of Sections to keep everything as organised as possible. The three most
important parts of Quest3D are listed below.
The Channels Section is the heart of Quest3D.
Quest3D shows the Channels Section on startup. In the Channels Section you will build the
foundation of all projects you create.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Note that it is possible to change the basic interface. Therefore, from user to user
Quest3D might look different. In this manual we will assume the standard
interface is used. For more information, please check the Customization
chapter in the Reference Manual.
This chapter only discusses the Channels Section. The Animation and Object
Sections are discussed in Part II: The virtual studio of this manual.
File menu
The File menu provides options for loading and saving projects. In addition, it
offers options for importing 3D objects from other programs, and publishing
Quest3D projects. The latter will be discussed in later chapters.
The New Project option will clear all previously loaded channel groups and
start a new workspace. During some of the coming tutorials you might want to
clear the project using this option. It is similar to quitting and restarting Quest3D.
Open Project allows you to load a single Channel Group or project file with a
different interface for Quest3D.
Saving a single Channel Group to a new file is done with Save Group As. To
overwrite your current file, Save Group is used. Using the Save All option
makes sure the entire project is stored.
Note that for new users Save All is the safest method to save a project.
15
16
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Section navigation
The different sections of Quest3D can be reached in a number of ways. Common
methods are using the Application menu or the Section selection buttons on
the Toolbar.
This is the same (type of) window as in the Animation Section. The Animation 3D
View window shows a real-time preview of a project. Changes and additions to
a program made in the Channel Graph will be immediately displayed in the
Animation 3D View window.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tab windows
Quest3D has many windows that use Tab controls to switch between them. The
most important of these in the Channels Section are the Template list, the
Channel list and the Search window.
Log Bar
The Log Bar is located at the bottom of the Quest3D program screen.
This bar notifies users of general information and specific issues. The history of
all notifications since the program was started can be viewed by pressing the
Log button.
17
18
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Channel Graph
The Channel Graph is the window where the channel structures are build.
Quest3D programs are made with building blocks. These building blocks are
called channels. Below is a picture of a channel in Quest3D.
Channel Group
The image below shows an example of a small group of channels. A structure of
channels is called a Channel Group.
The image above also displays an example of user comments (the text Hello
world example). In addition, certain building blocks have been hidden inside
folders.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
New channels can be added to your program by dragging a name from the
Templates List onto the Channel Graph. Dragging means pressing and holding
down the left mouse button, moving the mouse cursor to a new position, and
releasing the left mouse button.
19
20
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
After the mouse button is released, the channel is added onto the Channel Graph.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Templates
A Template is a predefined channel or group of channels. Using templates can
greatly speed up your workflow. Templates can be added just like single
channels.
In the example below, a Vector template is added onto the Channel Graph. A
Vector template consists of four channels.
21
22
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Drag from a to b
Select an item
Q u e s t 3 D
3 . 0
T u t o r i a l
23
M a n u a l
Tutorial
The folowing tutorial is an introduction to the Quest3D user interface. It also
takes a closer look at channels (building blocks). The goal of this tutorial is to
familiarise yourself with the basics of the Quest3D user interface.
Starting Quest3D:
From the Start Menu that comes up, choose the following options:
Programs > Act-3D > Quest3D 3.0 > Quest3D 3.0
Step by step:
Examine the screen. By default, Quest3D opens with one of the Channel
Sections. The Channels Section is where the actual program is created, using
building blocks called channels.
From the Applications Menu, choose Sections > Animation to switch to the
Animation Section.
Switch to one of the other Sections by choosing it from the Application
Menu.
Switch to one of the other Sections by pressing the appropriate button on the
Toolbar.
Go to the Object Section.
24
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Place the mouse cursor over the Channel Graph. Zoom in and out by
scrolling the mouse scroll wheel up and down.
If your mouse has only two buttons: hold down the Alt key on your
keyboard, press and hold down the right mouse button, and move the mouse
up and down to zoom in and out.
Zoom in on the Channel Graph to get a closer view of the channels in a project.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Place the mouse cursor over the Channel Graph. Press and hold down the
middle mouse button and move the mouse to move the view of the Channel
Graph.
If your mouse has only two buttons: use Alt + Left Mouse to move the
view.
Look at the Templates List on the left hand side of the screen. It contains all
sorts of channels and combinations of channels with a wide range of
functionality.
Click on the + sign next to the word Logic. Note the structure expands to
reveal a number of items.
Move the mouse cursor over the word Channel Caller.
(A Channel Caller channel is used to create the logic path of your project. For
example a Channel Caller named Project Start might call another channel
named Render Scene and another named Do User Logic).
25
26
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Click and hold the left mouse button, and move the mouse cursor to the
center of the screen, below the Project Start channel.
Release the left mouse button. You have just dragged a channel onto the
Channel Graph.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Click on the Project Start channel to select it. Note the red selection outline.
27
28
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
When at a new position, release the left mouse button. Note the channel is
moved.
To select multiple channels at once, create a selection box around them.
Starting at the top left corner in the Channel Graph, press and hold the left
mouse button. Drag the mouse to below and to the right of the channels you
want to select. Release the mouse button.
In the image above, the left mouse button is pressed at position 1. The
mouse is then moved to position 2, creating the selection box and selecting
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
all channels inside this box. Selected channels can be recognised by a red
outline.
To move multiple channels at once, first make a multi-selection. Next, move
the mouse over any of the selected channels. Press and hold down the left
mouse button and move the mouse.
After releasing the mouse at a new position all selected channels are moved,
relative to the new position and relative to each other.
Select the Channel Caller channel and press the spacebar on your keyboard.
The channel is stored in a Folder.
29
30
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Folders are named after the channel the mouse cursor is over when creating the
Folder.
Select the Folder and press the spacebar again to ungroup the Folder.
Select the Channel Caller channel and press the Delete key on your
keyboard to delete it.
Q u e s t 3 D
3 . 0
T u t o r i a l
31
M a n u a l
1.6 Channels
Quest3D programs are made with building blocks. These building blocks are
called channels. Each channel has a specific function.
In Quest3D, channels are rectangular blocks. The channel in the image below is
called a Value channel. It can store a number.
The small black squares above and beneath a channel are called link squares.
Channels can be connected to each other by lines between top and bottom link
squares.
In the image above, the upper channel is called the Parent. The lower channel is
called the Child. Children are often used as input or output data for Parents.
32
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Channel Groups
A structure of connected channels is called a Channel Group. A Quest3D project
consists of one or more Channel Groups. For example, one group might display a
room on screen while another group might show a character. The two Channel
Groups may be combined to display a character in a room.
Channel information
Information on a channel can be viewed by moving the mouse over it. After a few
moments, a pop-up window appears.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The information window also shows that this first link square only accepts
channels of Basetype Value. Therefore, the channel called My Value is accepted
as a child. In the image below, the My Value channel has a value of 0. The
33
34
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
second and third link squares of the Clear Screen channel are empty, and
therefore also 0. The color of the Clear Screen channel is (0, 0, 0), which is black.
Note that the grid is only visible in the Quest3D editor itself, not in stand-alone
programs. The grid is a Quest3D Helper item.
The image below shows the result of the My Value channel with a value of 0.5.
The background is colored dark red.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
User input
The image below displays the information for a channel called My Spacebar
Value.
This channel is again of Basetype Value. However, its Type is User Input. A User
Input channel can convert many different types of user activity like keyboard,
mouse and joystick input to a value.
Since the My Spacebar Value channel is of Basetype Value, it is also accepted as
child by the Clear Screen channel.
In the images above and below, the Clear Screen channel changes color from
black to red based on user input. When the spacebar is pressed, the background
color changes to bright red.
35
36
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Multi-link squares
The image below shows four different channels: two Channel Callers, a Value and a
Clear Screen channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Different channels can have different numbers and Types of link squares. For
example, the Clear Screen channel accepts three children and the Value channel
accepts one child.
A + symbol inside a yellow link square indicates multiple children can be linked
to a channel. Once a child is linked, the + symbol will move to the right, creating
a new spot for another child.
Linking
Moving the mouse over the top link square of the Channnel caller channel
makes the link orange.
In the image below, a linking action is started from the Channel Caller channel
to another channel by pressing and holding down the left mouse button.
37
38
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
During a linking action, all link squares change color to either red or green.
Connections can be made to green link squares, but not to red ones.
In the image above, a link is started from a channel of Type Channel Caller (it also
has the name Channel Caller). The Project start channel (of Type Channel Caller
as well) accepts this link as can be seen by the green link square.
Channels of Types Clear Screen and Value only accept Values. Therefore, their link
squares are red.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Releasing the left mouse button on a link square will create the link, if the link is
valid.
Instead of moving the link on the target link square you can also release it over
the channel itself. Quest3D will attempt to link the channel to one of the open
and valid link squares of the target channel.
Quick linking:
1.
2.
3.
Deleting links
Moving the mouse over the arrow of the link between the channels and pressing
the left mouse button you can select the link. You are now able to delete the link
by pressing the Delete key on your keyboard.
39
40
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
If a link is deleted from a channel that creates new link squares an empty link
square is left behind. This link square has the blue color. Channels will ignore
these empty spaces. If you link a new child to a channel with a blue link square
the empty position will be filled first.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
In its properties window you can enter a new value. Note that the Quest3D
program does not pause when opening a dialog. You can change values while
your program is running and instantly see the result.
Context Menu
Right clicking on a channel will bring up its Context Menu.
41
42
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Shortcuts
Channel shortcuts work in the same manner as Windows shortcuts to programs
or folders. In Quest3D only shortcuts to channels can be made, not to folders.
Channels shortcuts can be created through a channels Context Menu. Shortcuts
can also be made by right clicking on the arrow of a link between two channels.
A menu with a single option appears.
43
44
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The following exercise deals with channel properties. After completing it, you
should be able to find and understand Types and Basetypes, of both channels and
link squares.
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Move the mouse cursor over the Value channel and wait for the pop-up
window with information to appear.
Move the mouse cursor over the small black square on top of the Value
channel. Note the black square turns orange.
Click and hold down the left mouse button, and move the mouse cursor over
the center of the Clear Screen channel. Do not release the mouse button yet.
Note a black line is drawn from the top of the Value channel to the current
position of the mouse cursor.
Release the left mouse button. Note a black line is drawn from the top of the
Value channel to the bottom of the Clear Screen channel. The two channels
are now connected.
45
46
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Move the mouse over the Clear Screen channel and right click to bring up
its Context Menu. Select the Set as start channel option.
The image on the right shows the large arrow symbol on top of the Clear
Screen channel. It indicates the channel is the start channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Type in a new value from 0 to 1.0 in the edit box. Note that changing the
value in the dialog window affects the background color in the Animation
3D View window.
Press the OK button to accept and close the dialog window.
From the Applications Menu, choose the File option and then the Save
Group As option.
Find an appropriate location to store your project files, for example the
following directory:
C:\Program Files\Act-3D\Quest3D 3.0\Projects\
47
48
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
An example of what your program should look like is available in the Quest3D
program folder. Its directory and name is listed below. As noted in Chapter 1.2,
How to use this book, ..\ is an abbreviation of the following folder:
C:\Program Files\Act-3D\Quest3D 3.0\
To load a Quest3D project, from the Applications Menu, choose the File
option and then the Open Project... option.
Locate the directory given below under Finished scene. The complete path
is:
C:\Program Files\Act-3D\Quest3D 3.0\Tutorials\1.6 Channels\
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Set as start channel option in a channels Context Menu can be used to
define the beginning of a Quest3D program.
In the image below, the Channel Caller channel is the Start Channel and has two
children linked to it.
Channel Callers are the foundation for the workflow of your project.
49
50
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Project activity
A Quest3D project is only actively executed when the Animation 3D View
window is open.
In the image above, the Start Channel is actively executed, as can be seen by the
blue lines around the channel.
The image below shows a small Quest3D scene. On the left hand side, the channel
structure is visible. On the right hand side is a preview of the scene in the
Animation 3D View window.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Frames
Quest3D works in real-time. This means it constantly executes a project
completely and updates the preview. One complete cycle through the channel
structure is called a frame. Calculating all end result is referred to as rendering.
The framerate defines how many times per second a program is executed.
Framerates depend on the complexity of a project and the computer hardware
used to render a scene.
Program flow
Calling a channel in Quest3D means carrying out all of its functionality once,
based on any input it may receive from its children. The exact results of calling a
channel depends on its Type.
A Channel Caller calls its children in a left to right order. In the image below, the
Caller 1 channel is called first, displaying a box object on screen. Next, the
Caller 2 channel is called, rendering a fire object.
51
52
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
1.
2.
3.
4.
5.
When the structure is completely executed, the program begins anew with the
Start Channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
53
M a n u a l
Tutorial
The following exercise illustrates the flow of a Quest3D program.
Step by step:
Start Quest3D.
Open the scene Program flow.cgr. It can be found in the location specified
above. The file contains a simple scene with a box and a fire object.
Make sure the Animation 3D View window is active by pressing the
appropriate tab in the lower left corner of the screen.
Examine the scene in the Animation 3D View window. Note the box and the
fire object are both rendered.
Right click on the Caller 1 channel and from its Context Menu, select the
Set as start channel option.
Examine the scene in the Animation 3D View window. Note only the fire
object is visible.
Right click on the Caller 2 channel and from its Context Menu, select the
Set as start channel option.
Examine the scene in the Animation 3D View window. Note only the box
object is visible.
Finished scene:
54
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
1.8 Templates
A template is a predefined channel or group of channels designed to speed up the
workflow.
Templates can immediately be used in a scene. A benefit of working with
templates is that you dont have to understand each of the components right
away. Later on, when you are more familiar with Quest3D, you can take a better
look at all the various templates. You can even build your own.
Below is a quick list of the categories of templates that come with Quest3D. It is
intended to give you an impression of the scope of the entire set. The rest of this
manual discusses many of these templates and their functionality in greater
detail.
Category
Description
Example templates
Scene
3D stage setup
Objects
Logic
Variables
Render
Camera
Light
Primitive Object
Texture
Particle System
Pixel Shader
Vertex Shader
Channel Caller
If
Trigger
Channel Switch
User Input
Finite State Machine
Motionplanning
Value
Vector
Matrix
Text
Expression Value
Q u e s t 3 D
3 . 0
T u t o r i a l
55
M a n u a l
Category
Description
Example templates
Animation
Sound
Physics
Physics simulation
(based on Open Dynamics Engine)
Network
Database
Connecting to a database
Dynamic
Loading
Windows
Pop-up windows
Viewers
Project viewers
System
VR
Timer Value
Timer Command
Motionset
Wav File
Mp3 File
Sound Command
ODE Body
ODE Joint
ODE Command
Network Value
Network Text
Network Actions
DB Source
DB Query
DB Value
Save Channel to Buffer
Array Buffer
Remove Group
Message Box
File Dialog
Open URL
ActiveX Event
WinAmp Waveform
System Info
System Command
Glove
56
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
1.9 3D scenes
All Quest3D programs share the same basic principles. This chapter is an
introduction to creating a project in Quest3D.
Quest3D scenes
3D objects play an important part in most Quest3D programs. 3D objects can be
imported from your favorite 3D modeling package. It is also possible to use one
of the 3D objects that comes with Quest3D.
Just like a movieset, a Quest3D scene needs a camera and one or more lights.
The Render channel is used to display 3D objects on the screen.
The Start 3D Scene channel is used to initialise the 3D environment. It handles,
amongst other things, screen resolution and background color.
The Start 3D Scene, Render, Camera, 3D Object and Light channels are combined in
the following channel structure.
Q u e s t 3 D
3 . 0
T u t o r i a l
57
M a n u a l
Tutorial
In this tutorial you will create a simple Quest3D program. The result will be a
scene with a 3D object, a camera and a light.
In this introductory chapter, you will make use of templates. Templates are
predefined channels or groups of channels designed to speed up your workflow.
The templates used in this tutorial are listed below under Needed templates.
The first goal of this tutorial is to familiarise yourself with the basic structure of
Quest3D programs. The second goal is to gain more experience with adding
channels to a program and connecting them to each other.
Needed templates:
Step by step:
Start Quest3D.
Create a new scene by choosing File > New Project... from the Application
menu. Name it First project scene.
In the Template List, find the Start 3D Scene template. Its location is given
above, in the Needed templates list:
3D Items \ Start 3D Scene
Click the + sign in front of the word 3D Items in the Templates List. The
3D Items subfolder is expanded. One of the templates listed is the Start 3D
Scene channel. Drag a Start 3D Scene channel onto the Channel Graph.
58
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Right click on the Start 3D Scene channel and from the menu, choose Set as
start channel.
Find the Render channel in the Templates List. Its location is given in the
Needed Templates list above.
Drag a Render channel onto the Channel Graph, just below the Start 3D
Scene channel.
Link the top link square of the Render channel to the child link square of the
Start 3D Scene channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Drag a Point Light template onto the Channel Graph. Connect the Scene
Light channel to the last child link of the Render channel. Note how the car
is affected by this lightsource.
59
60
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Your current channel structure should look similar to the one in the image
below.
From the Applications menu, choose File > Save Group As....
Locate the following folder:
C:\Program Files\Act-3D\Quest3D 3.0\Projects\
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
61
M a n u a l
1.10
Publication
At a certain point, a Quest3D project may be finished and ready for distribution.
Whether it is a modest free screensaver or an extensive commercial training
application, the Quest3D program must be exported out of the editor and saved
into a format the target audience can run.
Depending on the Quest3D license you work with, a number of publishing
options are available.
Lite
Yes
Yes
Yes
Yes
No
No
Professional
Enterprise
VR
Yes
Yes
Yes
Yes
Yes
Yes
Published projects using the Lite Edition will display an extra Quest3D splash
screen on start-up.
All Quest3D programs require DirectX 9.0 or higher to be installed on a target
computer. DirectX is a free extension pack for Microsoft Windows and can be
downloaded from their site:
http://www.microsoft.com/directx/download/ [~10 MB]
62
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
License fees
Regardless of the Quest3D license you work with, no additional fees will ever be
charged by the developers, Act-3D. After expenses for the Quest3D software
package itself, there are no extra costs.
Q u e s t 3 D
3 . 0
T u t o r i a l
63
M a n u a l
Tutorial
The following tutorial is aimed at familiarising you with the various types of
publication. In order, the .q3d project file, the stand-alone .exe program, the
installer and the web application are discussed.
..\Tutorials\1.10 Publication\Publication.cgr
Step by step:
64
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
in
Locate the file Product_Visualisation.q3d in and double click it. The scene
will load and be run using the Quest3D Project Viewer.
Test the scene by holding down the right mouse button and dragging the
mouse to orbit around the 3D object.
When ready, press the Escape key to exit the application.
Note that both the Quest3D Project Viewer and DirectX 9.0 or higher must be
installed on a computer in order to run .q3d files.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Note that the Quest3D Project Viewer is not needed to run stand-alone .exe files
created with Quest3D. However, DirectX 9.0 or higher must still be installed.
65
66
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Note that the Quest3D Browser Plug-in and DirectX 9.0 or higher must be
installed on a computer in order to run Quest3D web page applications. If the
Browser Plug-in is not yet installed, the webpage will automatically try to
download and install it. The user may cancel this operation.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Also note that the actual application is a .q3d file. Both the .htm and the .q3d
file must be uploaded to an ftp server before others can view the web page
application on the internet.
Finished scenes:
67
68
Q u e s t 3 D
3 . 0
1.11
T u t o r i a l
M a n u a l
Summary
This first part of the manual was an introduction to the basic concepts of
Quest3D. Below some of the key points of this section are listed.
The first step in creating convincing 3D scenes, and keeping your project
managable, is being able to describe what you actually want to build.
Quest3D helps you to visualise your ideas.
Quest3D programs are made with building blocks. These building blocks are
called channels. Each channel has a specific function.
The small black squares above and beneath a channel are called link
squares. Channels can be connected to each other by lines between top and
bottom link squares.
The large area with the light blue background is called the Channel Graph.
The Channel Graph shows the channels used in a Quest3D program.
All Quest3D programs share the same basic principles. 3D objects play an
important part in most Quest3D programs. Just like a movieset, a Quest3D
scene needs a camera and one or more lights.
User input can be registered through for example keyboard, mouse, joystick,
drawing tablet and pen, and virtual reality gear.
Publishing a Quest3D project means taking it out of the editor and creating a
seperate, stand-alone program.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
69
70
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
2.1 3D Objects
3D scenes on the computer consist of virtual objects. The appearance of these
objects is defined by a number of elements. The following image shows a cube
object.
Simple models such as a box are made up of only a few vertices (or corners),
while complex objects such as cars, buildings and characters can consist of many
thousands of such points.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Surfaces are built out of polygons. A polygon can have any number of
vertices, though in real-time graphics, they usually appear in the form of tris
and quads (3 and 4 vertices, respectively). Quest3D polygons consist of up to 3
vertices. The image below shows a cube object divided into three-sided polygons.
Textures
Individual polygons can be assigned a color, but often, another means to add
detail is chosen. A texture is an image that can be wrapped around a 3D shape.
An example is given below.
71
72
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
In real-time graphics, textures are most often used to define color and
transparency. In the image below, the texture is wrapped around a sphere object
and defines its color.
Applying the alpha texture above to the sphere object results in the image on the
right.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Objects in Quest3D
3D objects in Quest3D are split into two large parts: motion and surface.
Linked to the Motion channel are three Vectors. They describe the objects
position, rotation and size, respectively.
The Vectors themselves each consist of three Values. For animation purposes, these
Values can be replaced with Envelope channels. Animation will be discussed in
Chapter 2.2.
The actual shape of a 3D object in Quest3D is described in the second half of the
structure. Linked to the Surface channel are, in order, the 3D ObjectData, the
Material and the Texture channels.
The 3D ObjectData channel contains the vertices and polygons of an object. It also
contains information on how to wrap a texture around the shape.
The Material channel is subdivided into a number of aspects: Diffuse, Emissive,
Specular, Power, Alpha Diffuse and Texture Blend Factor.
73
74
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Diffuse vector contains an objects color, and consists of three components:
red, green and blue, or RGB.
The Emissive vector describes the amount of self-lighting the model has. Without
lights in your scene, an object with an Emissive vector of (0, 0, 0) is black.
The Specular vector defines the color and intensity of the highlight, while the
Power value controls the size of the highlight.
The Alpha Diffuse value defines the transparency of an object.
The Texture Blend Factor value defines how much of a texture is blended with the
Diffuse color.
The Texture channel represents the actual texture image applied to a surface. It
contains a diffuse (color) image, and may contain an alpha image.
Material settings and textures can be adjusted in the Object Section.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Application menu
Toolbar
4
5
6
7
8
9
10
11
12
13
14
Lighting tab
Animation 3D View tab
Object 3D View tab
Textures tab
Surface List
Object List
Log bar
75
76
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The following tutorial focusses on 3D objects in Quest3D. It is also an
introduction to the Object Section of the program.
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Drag the Tex Factor slider to a different position. Note how the
transparency of the object is affected.
Finished scene:
77
78
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
2.2 Animation
One of the most powerful features of Quest3D is that you can animate virtually
every aspect of your scene. For instance, 3D objects can be moved, rotated and
scaled over time. In addition, all of their surface properties can be animated, such
as their color and transparency values. 3D character models can be brought to life
by animating virtual skeletons inside of them. Music and sound can be triggered
on certain location- or time-based events. Menu windows can be moved or faded
in and out of the screen.
Envelopes
In Quest3D, animation often means changing values over time. The regular Value
channel can only store one value. To store animation data, the Envelope channel is
used.
The interface of the Envelope channel looks like a mathematical graph. It works in
a similar way as well. The horizontal axis represents the input (often time), which
can be fed to the Envelope by connecting a (Timer) Value to its child link. The
vertical axis represents the output. Through (X, Y) pairs and interpolation, any
input can be converted to an output value.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Timers
The Timer Value and Timer Command channels allow for easy animation control.
Examples of Timer Commands are Play, Stop, Rewind and Play & Loop. In
the image below, a Timer Value channel is linked as input to an Envelope channel.
The Timer can be played using the Timer Command channel shown in the same
image.
A Timer can be named in the properties window of its channel. You can create as
many seperate Timers as needed in a scene.
79
80
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Timer Value channels are automatically adjusted for computer speed. In Quest3D,
25 frames equal exactly 1 second.
The Animation Section of Quest3D is where all objects are positioned and
animated.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Application menu
Toolbar
5
6
7
8
9
10
11
12
13
81
82
Q u e s t 3 D
14
15
Log bar
3 . 0
T u t o r i a l
M a n u a l
The Time Slider Bar allows you to insert keyframes and playback animations.
1
2
3
4
5
6
7
8
9
10
11
Start frame
Current frame
End frame
Timer List
Previous keyframe
Record
Play (and loop)
Next keyframe
Delete keyframe button
Insert keyframe button
Envelope controls
Q u e s t 3 D
3 . 0
T u t o r i a l
83
M a n u a l
Tutorial
This tutorial introduces time-based animation in Quest3D. After completing it,
you should have an understanding of Envelopes, Timers and Timer Commands.
..\Tutorials\2.2 Animation\Animation.cgr
Needed templates:
Step by step:
Open the scene Animation.cgr. It contains a simple scene and two spheres.
Drag a Timer Value channel onto the Channel Graph. Connect it to the Red
Sphere Timer Value channel.
84
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Double click on this Timer Value channel to open its properties window.
From the drop-down list, select New... In the pop-up window, enter the
name Blue Sphere and press OK.
Move the blue sphere by changing one or more of the coordinate values in
the Transform Type-in fields. They are located in the lower-left corner of the
screen, under the Move button.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Move the Time Slider to frame 0, and press the Insert keyframe button. In
the pop-up window, type in 250, and confirm by clicking OK. The current
motion (position, rotation, scale) of the object at frame 0 is copied to frame
250. The animation now loops properly.
Press Play to examine the new, longer animation you just created. When
ready, press Stop.
Make adjustments if needed.
Go to the Channels Section.
Locate the Env X channel, which is part of the position vector of the Blue
Sphere object. Double click on the Env X channel to open its properties
window.
Click on one of the keyframes to select it, and drag it up or down to change
its value.
Drag the keyframe left and right using the right mouse button. This changes
the keyframes position on the horizontal axis (time).
In the Vert. Value (out) box, type in a value for extra precision.
Click OK to accept your changes and close the Envelope editor window.
85
86
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
button.
Switch to Run Mode by pressing the
Press the spacebar. The animation starts playing, and loops.
Press the escape key. The animation stops.
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
.X files
Before you can use your own models in Quest3D, you will need to convert them
to the Microsoft DirectX .X file format. .X files contain all wireframe, surface,
texture assignment and animation data of an object, and can directly be imported
into Quest3D.
The .X file exporter plug-ins for a number of modelling packages are shipped
with Quest3D. To install the appropriate one, from the Windows Start Menu,
select
Programs > Act-3D > Quest 3D 3.0 > Extras > Exporters >
followed by the program directory and version of your choice.
Make sure you install the utility to the correct plug-ins subdirectory of the
modelling package.
Appendix A1 details preparation of 3D objects in and export from 3d Studio Max
and Maya. In addition, export and import using Polytrans is described.
87
88
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
In the following tutorial, a simple object created in one of the modeling packages
mentioned above is exported to the .X format. It is then imported into Quest3D.
Preparation:
Select Go!.
The directory ..\Resources\3D Models\ on your harddisk contains a number of
objects in .X file format. You can also use one of these models to complete this
tutorial.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed .X file:
..\Resources\3D Models\Cars\Car.X
Needed templates:
Step by step:
Press OK to accept.
Note that the 3D model from the .X file is now imported into Quest3D. It is
stored in the standard 3D Object channel structure.
89
90
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Drag the Simple Scene template onto your Channel Graph, above the object
channels.
Select and delete the Primitive Object channel and all its children.
Right click on the Start 3D Scene channel, and select Set as start channel.
Make sure the Animation 3D View displays the scene using the Project
Camera
.
Link the 3D object you just imported to the Render channel. It should now
appear in the Animation 3D View window.
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Textures
A texture is an image that can be wrapped around a 3D shape. In real-time
graphics, for performance reasons, their dimensions in pixels (width and height)
must be a power of 2. In Quest3D, they must also be greater than 8. Dimensions
of 32x32, 128x256 and 256x256 pixels are all valid sizes.
Larger dimensions mean larger file sizes, and an increase in memory use. Even
though todays graphics hardware can have 64, 128 or even 256 MB of texture
memory, inefficient use of textures may cause problems. While a .jpg image with
dimensions of 2048x2048 pixels might take up as little as 40 kb of harddisk space,
it takes up over 8 MB of texture memory.
It is recommended to keep texture dimensions as small as possbile, without
sacrificing detail. A good rule of thumb is to use sizes no greater than the texture
will ever be seen on screen. For example, for buildings in the distance of a scene,
128x128 pixel textures might be enough. Grass planes might not need to be
greater than 32x32.
91
92
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Compression
In addition, textures in Quest3D may be compressed. The image quality might
slightly decrease, but compressed textures may use up to four times as little
memory as uncompressed versions. Creating a 3D scene is constantly balancing
between quality and performance.
Mipmaps
Larger textures on distant surfaces might produce artifacts.
Using mipmaps on the square in the image above results in the following picture.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Note that the smaller versions take up texture memory as well. Also, when
loading a Quest3D scene, mipmaps must be generated at start up. This might take
some time, depending on the number of textures in the project, their dimensions,
and the number of mipmaps specified per texture.
UV Mapping
Textures are wrapped around a 3D object according to so called UV coordinate
sets. UV coordinates specify where each pixel of a texture is drawn onto a
surface.
Quest3D can handle simple UV mapping methods such as planar and cubic,
shown in the image below. These simple UV mappings can be moved and scaled.
93
94
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
UV coordinates range from 0 to 1.0. (0, 0) is the top left corner of an image, while
(1.0, 1.0) is the bottom right corner.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Transparency
Surface transparency may be handled in a number of ways. In the Object Section,
on the Surface tab, the Transparency dropdown list provides a number of
options.
The top row in the image below shows the following transparency methods, in
order: No Transparency, Multiply and Add. The bottom row shows, in order,
Add Smooth, Alpha Value and Alpha Texture.
95
96
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Multiply can be used for dark windows or shadows for example. Add
produces a glow effect. Add Smooth is a subtle version. Alpha Value makes a
surface transparent from 0% to 100%. Alpha Texture is used to precisely specify
transparency.
Texture stages
More than one texture may be applied on a surface. The maximum number of
texture stages that can be used per surface depends on the graphics hardware.
Most graphics cards support two stages, and newer graphics cards support three
or four. Chapter 10, Landscapes, discusses an advanced blending method based
on multiple render passes.
The various texture stages of a surface may be blended together in a number of
ways. In the Object Section, on the Surface tab, the Texture Blending dropdown
list provides a number of options. They are similar to the options in the
Transparency drop-down list, discussed above.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The top row in the image below shows three source textures: stage 1, stage 2 and
an alpha map. The bottom row shows the following blending methods, in order:
Multiply, Add, Alpha Value (50%) and Alpha Texture.
The Multiply setting typically results in darker colors. Add produces lighter
colors. Alpha Value blends two stages from 0 to 1 (0% to 100%). Alpha Texture
is used to precisely specify a blend.
UV sets
A surface may have more than one set of UV coordinates. The maximum number
of UV sets depends on the graphics hardware. Most cards support up to two sets.
Blending texture stages with seperate UV coordinates may be done to mask
repetition. In addition, effects such as light mapping need their own sets.
The image below shows two texture stages, each with their own uv mapping. The
blending result is shown on the right.
97
98
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Object sorting
When rendering a scene, Quest3D automatically sorts all surfaces to display them
in the correct order. Sometimes, especially with transparent objects, glitches cause
a surface to be sorted incorrectly. In this case, (part of) the surface is rendered
behind or through another while it should be in front.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The surfaces from the image above are now rendered in the correct order, as
shown in the following picture.
Alpha artifacts
Alpha textures used to define transparency may sometimes produce unwanted
results.
99
100
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Pixels that should be transparent may be knocked out with the Reject Alpha
Pixels setting. It can be changed in the Object Section, on the Surface tab, in the
Advanced.. mode. The Ref value defines the threshold for knocking out
unwanted pixels.
The image below shows the texture surface with proper alpha transparency.
Q u e s t 3 D
3 . 0
T u t o r i a l
101
M a n u a l
Tutorial
This tutorial deals with textures, transparency, blending methods and surface
sorting. At the end of this chapter you should be able to work with textures in
Quest3D.
Needed textures:
..\Resources\Textures\Architecture\Buildings_128.jpg
..\Resources\Textures\Landscapes\Grass.jpg
..\Resources\Textures\Reflection\Reflection_1.jpg
Step by step:
102
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Examine the grass landscape from this perspective. Note the visual artifacts
further away from the camera.
On the Textures tab on the right side of the screen, locate the highlighted
texture called Grass.jpg and double click it. In the properties window, note
the MipMap Count value is currently 1. Change it to 0 to let Quest3D
automatically decide how many mipmap levels are needed. Press OK to
close the Texture window.
Reexamine the grass landscape. Note the visual artifacts further away from
the camera are much smoother now.
icon to display the scene using the Editor Camera.
Press the
In the Objects List in the lower right corner of the screen, click on the Car
object to select it.
In the Surfaces List in the lower part of the screen, click on the Chassis
surface to select it.
On the Texture Stages tab on the right side of the screen, click on the Stage
2 tab.
On the Textures tab on the right side of the screen, press the Load button
to load a new texture. Locate the ..\Resources\Textures\Reflection\ folder.
Select the file Reflection.jpg, and press Open to accept. Press OK to close
the Texture window.
Click on the new texture to apply it to the Chassis surface of the Sports Car
object. Note the texture is stretched across the car.
On the Texture tab on the left side of the screen, from the Mapping
dropdown list, select Reflection map (CamReflvec). Note the UV mapping
is affected.
Orbit the Editor Camera around the car. Note the UV mapping is affected.
On the Surface tab, from the Texture Blending dropdown list select Alpha
Value.
On the Material tab, drag the Texture factor slider to 0.92. Note the
reflection stage is blended onto the diffuse texture stage below.
Orbit the camera around the car. Examine the reflection effect. If needed,
adjust the Texture Factor slider to change the amount of blending.
Click on the Windows surface in the list to select it.
On the Surface tab, from the Transparency drop down list select
Multiply. Note how the car windows become transparent and darker.
From the Transparency drop down list select Add. Note how the car
windows become transparent and lighter, almost glowing.
From the Transparency drop down list select Alpha Value. Note the car
windows become fully transparent.
103
104
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
On the Material tab, drag the Alpha slider to 0.5. Note the car windows
become 50% transparent.
Examine the trees in the scene. Note the square surfaces around their leaves
should be transparent.
Click on the Trees object in the list to select it.
Click on the Leaves surface in the list to select it.
On the Surface tab, from the Transparency dropdown list select Alpha
Texture. Note the squares around the leaves become more transparent. Note
there is still an unwanted outline around the leaves.
On the Surface tab, click on the Advanced.. button.
Select Reject Alpha Pixels and type in 150 as Ref value. Note the outline
around the leaves disappears.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
105
106
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Light types
A light in Quest3D may be of one of three types: point, spot and directional,
shown in the image below.
A point light radiates light into every direction. A spotlight is defined by an inner
and outer cone angle, resulting in a simulated fall-off effect. A directional light is
simply a rotation vector along which the source emits light. All rays of a
directional light are parallel to each other.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
A Quest3D light can be colored through its Diffuse vector. The Ambient vector
serves as a global Emissive vector to all objects affected by the light source.
1)
2)
3)
Object Diffuse (1, 1, 1), Light Diffuse (1, 1, 1), Light Ambient (0, 0, 0)
Object Diffuse (1, 1, 1), Light Diffuse (1, 1, 1), Light Ambient (0.4, 0.4, 0.4)
Object Diffuse (1, 1, 1), Light Diffuse (1, 0.8, 0.6), Light Ambient (0, 0.2, 0.4)
107
108
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Shadows
Shadows for dynamic objects, such as cars or walking characters, can be
simulated using texture squares.
Such shadow planes are rendered fast, and produce convincing results.
Real-time shadows
Quest3D also supports real-time shadows. The Stencil Shadow channel can be seen
as a Render specialised in calculating shadows. The Stencil Shadow channel
requires a light source position vector to work. 3D Objects may be linked to the
StencilShadow by means of a SoftwareStencilShadowObject.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
109
110
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Light mapping is the process of calculating lighting and shadows once, and
storing the information into a texture. The resulting light maps are then applied
on an object on a second texture stage, and blended with the diffuse texture.
Light maps can be generated in a number of advanced 3D modelling software
packages such as 3D Studio Max and Maya. It is also possible to create lightmaps
in Quest3D.
In the Object Section, on the Texture Lighting tab, a number of settings define
the quality of a Quest3D light map. Renders and lights can be selected, as well as
texture width and height. It is possible to calculate lighting, shadows or both.
Finally, the Anti Aliasing setting controls the smoothness of the lightmap.
Before a 3D object can be lightmapped, it needs a
proper UV set. For fairly simple objects such as planes
and landscapes, Quest3D planar UV mapping may be
used. For more precise UV mapping, please refer to the
manual of your favorite 3D modelling software
package.
Q u e s t 3 D
3 . 0
T u t o r i a l
111
M a n u a l
Tutorial
Needed Quest3D scene:
Needed templates:
Step by step:
112
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Add a Vector channel and connect it to the Ambient child link of the Sun
Light channel. Change its values to (0.4, 0.4, 0.4). Note both the character and
the environment appear brighter, as if affected by ambient day light.
Drag a Render Stencil Shadow channel onto the Channel Graph and connect it
to the Project channel.
Make a shortcut of the position vector of the Sun Light channel and connect
it to the Light vector child link of the Shadow Renderer channel.
Add a Software Stencil Shadow Object channel and connect it to the Stencil
Shadow Base Object child link of the Render Stencil Shadow channel.
Make a shortcut of the Animated Character channel and connect it to the
Software Stencil Shadow Object channel. Note the character object now
casts a shadow onto the environment.
Go to the Animation Section.
Move the Animated Character object around. Note the shadow is cast from
the position of the sun.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
On the 'Material' tab, set the 'Tex Factor' to '0.75'. Note the light map layer
blends with the texture layer below.
On the Lighting tab, adjust the Width and Height to 1024, and set the
Anti Aliasing to 4x.
Create the final high resolution light map with these new settings by pressing
the Calculate Lighting button. Note that calculation time increases.
Wait for the light map to be finished, and examine the result.
Create light maps for the remaining surfaces of the 'Street' object.
Finished scene:
113
114
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
2.6 Cameras
A camera defines the point of view from which a scene is presented. Choosing the
right camera for a project is important, as it influences the way users experience a
scene in a very direct way. This chapter discusses a number of available camera
templates and general properties.
Animation Camera
An Animation Camera may be used to guide a user through a scene. The animation
camera is similar to a real-life freehand cinematic camera. It may also be the
preferred camera for non-interactive scenes such as visualisations, documentaries
or screensavers.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Zoom factor
The zoom factor is a quick way to zoom a camera in or out. The default value of
1.0 results in a normal view. A higher Zoom Factor brings the scene closer, a
lower value sets it further away.
Clipping planes
The clipping planes of a camera are virtual boundaries between which a scene is
rendered. Polygon surfaces outside of these boundaries are not calculated.
By attaching a Field of View Matrix template to a Camera, it is possible to manually
define the clipping planes. This template allows the field of view angle to be
changed (in degrees). Values of 50 to 90 degrees are standard.
If the clipping planes are positioned, so that there is a smaller amount of
geometry rendered, the performance of the project will increase.
115
116
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Fog
Fog can be used to blend various elements in a virtual environment together. It
can add to the mood of a scene and suggest depth. A bonus of using fog is that
the far clipping plane of the camera may be decreased to just behind the Fog
End value. If used right, this will result in a smooth transition between the scene
and the nothing beyond the far clipping plane.
Q u e s t 3 D
3 . 0
T u t o r i a l
117
M a n u a l
Tutorial
Needed Quest3D scene:
Needed templates:
Step by step:
Open the scene Cameras 1.cgr. This scene contains a car connected to a
render.
Drag the Object Inspection Camera template onto the Channel Graph. Link the
Object Inspection Camera to the Render channel.
Go to the Animation Section.
Make sure the Animation 3D View window displays the scene using the
Project Camera.
Switch to Run Mode.
Click and hold the right mouse button and drag the mouse around to orbit
around the car.
When ready, switch to Edit Mode.
Finished scene:
If you wish, you can save the current channelgroup to your project directory. The
following steps deal with a new scene.
118
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed templates:
Step by step:
Open the scene Cameras 2.cgr. Go to the Channels Section. This scene
contains a city block consisting of a number of buildings, connected to a
render without a camera. Three parts of the city, the Car,
Building_Collision_Objects and Street, are going to be used as collision
objects.
Switch to Edit Mode.
Drag in a Collision Object, and connect the Street channel to it. Leave the
Street channel connected to the render.
Double-click on the Collision Object, and click on Create Tree. The object will
be calculated.
Drag a Walkthrough Camera template onto the Channel Graph. Do not
connect it to the Render channel yet.
Link the Collision Object to the last child link of the Fast Collision Response
channel of the Walkthrough Template.
Create Collision Objects for the Buildings and the Car. Disconnect the
Building_Collision_Object channel from the Render, but leave the Car
channel connected.
Connect the Walkthrough Camera channel to the Render channel. Note the
Animation 3D View window is updated and displays the scene from a
different perspective.
Link the Camera Logic channel to the Start3DScene. If you press Space, the
camera will reset to its original position.
To set the cameras height, double click on the folder In: Collision Spheroid
Radius (this is the second child of the FastCollisionResponse). This folder
contains a vector. To set the height of the camera, change the Y value into
another value, like 1.9.
Go to the Animation Section.
Switch to Run Mode.
Test the scene by walking through the city using the arrow keys and mouse.
Press the space bar to reset the camera.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
119
120
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Head-up Display
Non-interactive elements of the 2D overlay are part of the Head-up Display, or
HUD for short. Examples of HUD elements are score counters, company logos,
top down maps of the users virtual environment and spinning 3D
representations of the current physical condition of the users avatar in a
computer game.
The terms Graphic User Interface and Head-up Display are sometimes used
synonymously. In the picture above, the Quest3D logo and debug information are
part of the HUD and the RGB values and Rotation option are part of the GUI.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
GUI in Quest3D
In Quest3D, the 2D layer on top of the rest of the scene is rendered in a special
way. It is in fact a second 3D scene, rendered through its own camera with a
specific type of projection. GUI textures are made sharp by turning off the antialiasing filter.
Z buffer
Each frame, the entire 3D scene is rendered, followed by the GUI and HUD layer.
In between the Z Buffer is cleared, to prevent the 3D scene from interfering with
the overlay.
Mouse input
Mouse interaction with GUI elements can be monitored using the Mouse Over and
User Input channels.
2D images
Pixel-perfect 2D images can be rendered onto the screen using the Copy image
channel. No matter the screen resolution, the picture is always displayed in the
same absolute amount of pixels. This method produces crystal clear images.
Text
The Text Out channel can be used to quickly write 2D text onto the screen. Debug
information such as framerate and viewport resolution can easily be displayed
using this method.
Templates
A number of ready to use GUI elements can be found in the Templates list.
121
122
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
Graphic user interfaces consist of button and sliders that allow a user to influence
an application. The following tutorial deals with a number of such elements.
Step by step:
Open the scene Graphic user interface.cgr. It contains a car object and an
Object Inspection Camera. Note a Quest3D logo image is overlayed on top of
the scene displayed in the Animation 3D View window.
Create a shortcut of the Checkbox channel and connect it to the Mouse
Over Checkbox channel.
Create a shortcut of the Checkbox State channel and connect it to
theRotation? channel, which is part of the Motion of the Car object. Note
the Car object is located in the 3D Scene folder.
Go to the Animation Section.
On the Camera tab, select the GUI Camera.
In Move Mode, lock the Z position.
On the Object tab, select the Quest3D Logo object and move it to the lower
right corner of the screen.
Switch to Run Mode.
Hold down the right mouse button and drag the mouse to rotate around the
car object.
Click on the check box to test it. Note the car starts rotating.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
123
124
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
From simple menu click sounds to full ambient music, audio can really add to a
scene. It helps to set the mood, just as sharp graphics and lively animation can.
The use of spoken voice samples can help users to better understand an
application. Turn off the sound while watching television or playing a computer
game, and youll instantly miss the richness of audio.
Sound can be stored digitally on the computer, in many different formats.
Quest3D supports both .wav and .mp3 files.
.Wav format
The Sound File channel is used to store .wav samples within Quest3D. Its
properties window contains a number of options including icons to load, play,
stop and pause a sample. As the name suggests, the Repeat option allows for
continuous playback.
Speed ranges from 0% to 200%, and volume ranges from 0% to 100%. Both can be
dynamically changed through their respective child links. Panning controls how
the sound is divided between the left and right speaker: 0% means only the left
one is used, 100% means the right one. 50% (default value) plays the sound at
equal levels through both speakers.
125
126
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Sound Command
The Sound Command channel allows you to control all aspects of a sample, such as
playback and volume. It also allows for loading .wav files from harddisk. The
drop-down list presents all the various options. A Sound Command must be called
once to be executed, and affects all its children of the Sound File channel type.
3D positioning
Besides simply playing a sound, it is also possible to place it in 3D space. 3D
Positioned sound requires a Listener channel. It is usually connected to the
location of the virtual camera, and automatically adjusts volume, panning and
frequency by calculating a sounds relative position and distance. Only Mono
sound samples can be positioned in 3D space. The 3D Positioning options of the
Sound File channel define the quality of the simulation. Higher quality requires
more cpu power.
Silent at 1/* of full volume is a cut-off value that was implemented for
performance reasons only. The Half volume every * units setting can be seen as
the half life value of a sound. Changing this value allows you to simulate sources
of different sizes. A bee sound for example might have a half life value of 0.01
units, while the volume of a plane halves every 10 units.
The properties window of the Listener contains three advanced options.
The Doppler Factor describes the change in pitch when a sound moves away or
towards the listener. The default value of 1.0 produces an effect similar to real
world situations.
The Rolloff Factor affects the half life values of all the sounds in a scene. The
default value of 1.0 produces a real world simulation, 0.0 disables roll off
completely, and 2.0 exaggerates the effect.
The Distance Factor allows you to compensate for different measuring
systems. If one unit in Quest3D represents one foot in your models, you can enter
0.3048 as the distance factor.
3D Sound must be configured properly in Windows. Check the Sound and
Audio Devices settings in the Control Panel.
.MP3 format
The .mp3 format is also supported in Quest3D. The MP3 File channel is used to
store sound samples of this type. Through its properties window it is possbile to
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
load a file from disk. The Save File in Channelgroup option allows you to store
the sample data inside of the channel itself. This will of course increase the file
size of the channelgroup. The MP3Files only child may also contain a file name in
the form of a Text channel.
The MP3 Control channel can be used to control playback and volume. It can also
be used to retrieve information on total length and current playing position, and
to skip to a specific position in the sample.
MP3s cannot be positioned in 3D space.
127
128
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
Needed Quest3D scene:
Needed sounds:
..\Resources\Sounds\Bird.wav
Needed templates:
Step by step:
Open the scene Sound and music.cgr. It contains a simple 3D scene and a
walkthrough camera.
Add a Sound Command channel and double click it to open its properties
window. Choose the Play command from the dropdown list and press OK
to accept. Connect the Sound Command channel to the Play Sound
channel.
Drag a Sound File channel onto the Channel Graph and connect it to the
Sound Command. Double click it to open its properties window. Press the
Load icon , and locate the file Car engine.wav. Press Open to accept.
Make sure the Animation 3D View window is open.
Switch to Run Mode.
Test the scene so far by pressing the Space key. Note the Sound Command is
triggered once, and the sound is played.
Switch to Edit Mode.
Add another Sound Command channel and connect it to the Stop Sound
channel. Set this Sound Command to Stop. Link the Sound Command to the
Stop Sound channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Connect the original Sound File channel to this second Sound Command
channel.
Double click on the Sound File channel. From the 3D Positioning dropdown
list, select Normal. Tick the box Repeat to play the sound continuously.
Make a shortcut of the Motion channel of the Car channel, and connect this
shortcut to the first child link of the Sound File channel. The sound is now
connected to the location of the 3D object.
Drag a Listener onto the Channel Graph and connect it to the Audio channel.
Make a shortcut of the Motion of the Walkthrough Camera channel. Connect
this shortcut to the Listener.
Make sure the Animation 3D View window displays the scene using the
Project Camera.
Switch to Run Mode.
Press P to play the sound sample.
Use the arrow keys to move towards and away from the 3D object. Note how
the volume is affected.
Use the mouse to rotate your view. Note how the sound pans left and right
based on the relative position of the 3D object to the camera.
Finished scene:
129
130
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
2.9 Landscapes
Virtual outdoor environments can be very rewarding to create and to visit. They
can also become fairly complex rather easily, risking low framerates. This chapter
discusses methods to create landscape scenery and keep them running properly
by offering practical tips for optimisation.
Virtual landscapes are often created as large grid-like surfaces. The height (Yvalue) of the various vertices defines hills and mountains.
Height maps
Most commercial 3D modeling packages such as 3D Studio Max and Maya allow
you to create landscapes either directly or indirectly. A so called greyscale height
map can define the Y-value of the vertices that make up the surface: black is the
lowest point, white is the top.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Please refer to the help document of your favorite 3D modeling package for more
information. Keywords: height map, displace.
Textures
One or more textures are then applied to the surface. The various texture stages
may be blended into each another by alpha images.
Multiple passes
Chapter 2.4, Surface properties, discussed basic Quest3D blending methods. To
accomplish the effect above, and make it compatible with older graphics cards, it
is recommended to use multiple passes. This includes rendering a surface more
than once, and blending these instances by means of transparency.
Rendering a typical landscape surface could include the following passes:
1. The first layer, such as dirt (UV set 0)
2. The second layer, such as grass (UV set 0), blended by means of a seperate
alpha texture (UV set 1).
3. The light map layer, using a multiply operation (UV set 1).
Sky domes
The sky in a virtual outdoor scene is often represented as a dome.
131
132
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Lighting
Sunlight may be simulated by using a strong directional light. In addition,
emissive values of all 3D objects in the scene may be increased, suggesting
radiosity (indirect lighting). Light maps and real-time shadows can further
improve an outdoor scene. See Chapter 2.5 for more information on lighting and
shadows.
Fog
Fog can add to a mood and suggest depth. A bonus of using fog is that the far
clipping plane of the camera may be decreased, resulting in higher frame rates.
See Chapter 2.6 on cameras for further information.
Nature Painting
Many outdoor scenes display an abundance of trees and plants. Quest3D features
an advanced system called Nature Painting. It allows you to easily add
hundreds of trees and plants to a scene. The Nature Painting system is optimised
for performance and uses the graphics hardware of your computer to render
scenes quickly and efficiently.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Nature Generator channel is placed between the Surface and 3D ObjectData
channels of an object. It contains the position, rotation and scale of all its
instances, as well as extra information applying to all instances. A collision object
to paint on must be linked to the Nature Generator.
The Nature / Pathfinding Section provides easy access to all its functionality.
133
134
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Templates
Quest3D comes with a number of predefined landscape, tree and plant models.
They can be used directly from the Templates menu.
Q u e s t 3 D
3 . 0
T u t o r i a l
135
M a n u a l
Tutorial
Needed Quest3D scene:
..\Tutorials\2.9 Landscapes\Landscapes.cgr
Needed templates:
Step by step:
136
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Select the Alpha Texture transparancy option. Note the two texture layers of
the landscape are blended with each other now.
Select and delete the link between the 3D Object Data and Tree Leaves
channels.
Add a Nature Generator channel and connect it to the Tree Leaves channel.
Rename it Tree Leaves Nature Generator.
Connect the 3D Object Data channel to the Tree Leaves Nature Generator
channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Make a shortcut of the Collision Object channel linked to the Grass Nature
Generator channel and connect it to the Collsion Object child link of the
Tree Leaves Nature Generator channel. The Tree object is now ready for
painting.
Go to the Nature / Pathfinding tab.
Click on the Tree Leaves Nature Generator object to select it.
Press and hold the control key and click on the Tree Trunk Nature
Generator object to add it to the selection.
Click on the Paint Mode button.
In the Paint sizing options menu, set the randX, randY and randZ values
to 0.5. Place a few trees. Note how they vary in size.
Select the Area option, set the Size to 250 and the Density to 15%. Place a
few more trees with a single click.
Press the Paint Mode button again to exit.
Go to the Animation Section.
Make sure the Animation 3D View displays the scene using the Project
Camera.
Switch to Run Mode.
Test the scene by walking through the landscape using the arrow keys and
mouse.
Finished scene:
137
138
Q u e s t 3 D
2.10
3 . 0
T u t o r i a l
M a n u a l
Particle systems
Many special effects in movies and games, such as fire, smoke, explosions and all
kinds of magical effects, have one thing in common: they are all created using so
called particle systems.
Motion
For every particle in the system, the position, rotation and size is stored. In
addition, other attributes such as speed, color and transparency may be used.
Forces such as gravity may be applied to all particles in the system.
Emitters
Particles are released from an emitter. In Quest3D, this is in the form of an 3D
Object Data channel. The particle system cycles through all of the vertices in the
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
object and constantly emits a particle from one of these positions. By randomly
placing a number of vertices in 3D space, it appears as if the particles are released
randomly as well. This produces convincing results for special effects such as fire
and smoke.
Surface properties
The looks of a particle system are defined by the diffuse and alpha textures used
on the square objects. See Chapter 2.4 for more information of Surface properties
and blending methods.
Types
Quest3D comes with two particle systems. The Particle Object channel is the
compact variant, and can be used for simple effects such as fire.
The advanced particle system consists of a number of channels and can be used to
for example simulate smoke that stays within a collision object.
The advanced particle system allows for greater control of attributes such as
speed, rotation, size and color. Envelopes describing the desired functions may be
connected to the Particle Emitter channel. The Advanced Function Base Value is
used as index for each of these Envelopes.
139
140
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Reference Manual
The various channels of the advanced particle system are described in greater
detail in the Quest3D Reference Manual.
Q u e s t 3 D
3 . 0
T u t o r i a l
141
M a n u a l
Tutorial
Needed Quest3D scene:
Needed templates:
Step by step:
142
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Drag a Value channel onto the Channel Graph and connect it to the
Advanced Function Base child link of the Particle Emitter channel. Rename
the Value to Advanced Function Base.
Add a Vector (using envelopes) template and connect it to the Particle Color
Function child link of the Particle Emitter channel. Rename the Envelopes to
Red, Green and Blue, respectively.
Create a shortcut of the Advanced Function Base channel and connect it to
each of the three Envelopes you just added.
Double click on the Red Envelope to open the properties window. Add a key
at position (0, 0.5) and press OK to accept.
Double click on the Green Envelope to open the properties window. Add a
key at position (0, 0.5) and press OK to accept.
Double click on the Green Envelope to open the properties window. Add a
key at position (0, 0.5). Also add a key at position (50, 0) and press OK to
accept. Note that the particles will turn blue during their individual lifetimes.
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
2.11
M a n u a l
Character animation
Virtual skeletons
3D models can be set up to behave in a similar manner. The polygon surface of
the model can be seen as the skin. A virtual skeleton can be used to animate
various parts of this skin seperately. Practically speaking, each of the vertices of a
3D model must be linked to the appropriate bones of a virtual skeleton.
Advanced modeling software packages such as 3D Studio Max ship with premade virtual skeletons. These can be linked directly to your own character, or
adjusted and expanded if needed. Please refer to the manual of your favorite
modeling program to learn more about working with virtual skeletons.
Keywords: bone, animation, biped.
143
144
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Skinned Character channel is placed between the Surface and the 3D Object
Data channel. It contains the definition of the virtual skeleton, and information on
how the 3D model is connected to the virtual skeleton.
The Motionset channel contains all bone animation data in the form of keyframes
for position, rotation and scale.
The animation can be played by linking a value to the first child link of the
Motionset (for example, a TimerValue).
Switching Motionsets
Characters in a scene are likely to have more than one animation. At any given
point in time, they may stand still, walk, run or use an object for example. One
approach to alter between animations is to use a Channel Switch. Based on an
index value, one of the Motionsets is selected.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Motionset Blender
The solution above results in harsh transitions. To make animations transition
more smoothly, the Motionset Blender can be used. This channel accepts two
Motionsets and one Value. This value defines how much of the two sets is
displayed. A value of 0 means only the first Motionset is used, while a value of 1
means only the second is used. A value between 0 and 1 effectively blends both
sets through linear interpolation.
The image below shows 100% walk, 50% walk and sit, and 100% sitting
respectively.
145
146
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The blend value of a Motionset Blender can be derived from any kind of
information used elsewhere in a Quest3D program. Envelope channels can be used
to convert any value to the required range of 0 to 1. Example blend values include
User Input and object speed.
Value Damping
A compact and inexpensive way to animate the transition from 0 to 1 and vice
versa is by using a Value Damping channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
147
M a n u a l
Tutorial
The following exercise explains importing character animation into Quest3D. It
also describes motionset blending.
Needed .X files:
Needed templates:
Step by step:
148
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
149
150
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
If you wish, you can save the current channel group to your project directory. The
following steps deal with a new scene.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed .X files:
Needed templates:
Step by step:
151
152
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Release the arrow up key. Note how the Character Speed channel changes
in value. Note the character animation blends from Walk to Idle.
Switch to Edit Mode.
Add another Envelope and link it to the Value Damping channel connected to
the Motionset Blender binding the Walk and Run channels.
Make another shortcut of the Character Speed channel and connect it to this
new Envelope.
Double click on the Envelope. Add points at (0.25, 0) and (0.5, 1).
Go to the Animation Section.
Switch to Run Mode.
Test the scene by pressing the arrow up key. Note the character starts
walking.
Press and hold both the arrow up key and the shift key. Note the speed is
increased and the character starts running.
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
153
154
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
3.1 Logic
In Quest3D, logic is the flowchart of a program. Logic describes what happens
and when it happens.
Examples of logic:
Channel Caller
As their name implies, Channel Callers simply call the channels linked to them.
They are used to add structure to a project. Channel Callers can be seen as
dividers, or even chapters in a Quest3D program.
The image below shows an example of a program structure divided by Channel
Callers.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
If
Just like the Channel Caller, the If channel calls its children. The If channel only
calls its children, however, if a certain condition is met. This condition can be
linked to the first child link square of the Ifchannel, and must be a value. Only if
the value is not 0 (the condition is true), the channel connected to the Ifchannel
is called.
If Else
The IfElse channel is similar to the Ifchannel. If the attached condition is not met
(i.e. the value equals 0), the channel connected to the third child link is called. If
the condition is met the channel connected to the second child link is called.
Triggers
Trigger channels work in a way similar to Ifchannels. Triggers also call their
children based on a condition.
155
156
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
User Input
The User Input channel can register activity from a number of sources such as
keyboard and mouse. In Quest3D, user input results in one of three types:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
User input can serve as condition value for both If(Else) and Trigger channels.
Any key on the keyboard can be binded to a User Input channel through its
properties window. After clicking the Capture a key to use button, press the key
of your choice. In a similar way, any mouse or joystick button and movement can
be registered.
Channel Switches
Channel Switches allow you to choose between different channels of almost any
type. A Channel Switch must fist be set to the same base type as its children.
157
158
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Next, its first child defines which of the linked versions is used: a value of 0
results in the first variant being used, 1 in the second, etc.
Q u e s t 3 D
3 . 0
T u t o r i a l
159
M a n u a l
Tutorial
Logic in Quest3D defines the flowchart of your project. This tutorial is an exercise
in structuring a program using Channel Callers, and in working with conditions.
Conditions serve as input for Ifand Trigger channels.
After completing this tutorial, you should have a better understanding of logic in
Quest3D.
Needed templates:
Step by step:
Drag the Start 3D Scene onto the Channel Graph. Right-click it and choose
Set as start channel.
Add a Channel Caller and connect it to the Start 3D Scene channel.
Rename this Channel Caller to Program.
Drag five more Channel Callers onto the Channel Graph. Rename them as
follows: Logic, User Interface, 3D Scenes, Scene 1 and Scene 2.
Think about a logical structure and connect these five Channel Callers to your
program.
When ready, examine the channel structure in the image below to see if your
own solution looks similar.
160
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Currently, Scene 1 and Scene 2 are both called. The following steps will add
logic to displaye one or the other, based on keyboard input.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Double click on the User Input channel to open its properties. Click on the
Capture a key to use button and press the 1 key to bind it. Press the OK
buttont to accept.
button.
Switch to Run Mode by pressing the
Press and hold the 1 key. Note the Scene 1 channel is called.
Release the 1 key. Note the Scene 1 channel is no longer called.
161
162
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Double click on the Channel Switch channel to open its properties window.
From the list, select Channel Caller and press the Set button. Press OK to
accept.
Add a Value channel and connect it to the first child link of the Channel
Switch channel. Rename the Value to Current Scene.
Drag a Channel Caller onto the Channel Graph and connect it to the second
child link of the Channel Switch channel. Rename this Channel Caller to
Menu. Note the Menu channel is currently called.
Connect the Scene 1 channel to the third child link of the Channel Switch
channel.
Connect the Scene 2 channel to the fourth child link of the Channel Switch
channel.
Change the value of the Current Scene to 1. Note the Scene 1 channel is
called.
Change the value of the Current Scene to 2. Note the Scene 2 channel is
called.
Finished scene:
163
164
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
3.2 Math
Values are at the heart of any Quest3D project. They are used to define an objects
color, position and size for example. Values can also describe scores, program
settings, menu option etc.
Values in a Quest3D project often change. Regular math can be used to calculate
new values.
Set Value
The following statement describes a standard expression in regular math.
Old value = New value
In Quest3D, the above statement must be translated to the following.
Copy New value into Old value
To copy one value into one another, the Set Value channel is used.
In most practical cases Set Value channels need to be carried out only once.
Therefore, they are often called by Trigger channels.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Expression Value
Mathematical expressions can be described in Quest3D using the Expression Value
channel. It serves as an advanced calculator. Its properties window contains a box
for the actual formula, and help text describing all the usuable variables and
operators. The Reference Manual explains each of these elements in greater detail.
The actual value of an Expression Value is equal to the result of the expression
inside of the channel. This result is also displayed under Current Value in the
properties window.
165
166
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Brackets ( ) can be used to define priority of one part of the expression over the
other. The two expressions in the image below are not the same and therefor do
not produce the same result.
Values connected to the child links of the Expression Value can be used as part of
the expression within the channel as well. The first child is presented by the letter
A, the second by the letter B, and so forth.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Expression Value channel can be named after its expression by choosing the
Rename Channel to formula option in the properties window.
Expression Values can also serve as condition input for If and Trigger channels. In
the image below, the structure should be read as if A equals B then execute the
following channels.
167
168
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
In the image above, the condition is met if A==1 && B==2. The expression
should be read as, if A equals one and B equals two.
Expressions can also contain conditions in the form of If Else statements. In the
image below, the expression A==B ? C : D should be read as if A equals B then
the result is C else the result is D.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
In the image on the right, the condition A==B is met. The result of the
expression is the value of C.
Envelopes
Besides playing an important role in animation, Envelopes have other uses as well.
A graph in an Envelope channel is a two dimensional mathematical function. For
advanced simulations and models, actual formulas may be used by inserting a
number of coordinate pairs into the graph. Quest3D will handle the interpolation
between these points.
169
170
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The graph in the image above limits input values to output values between -1
and 1.
Q u e s t 3 D
3 . 0
T u t o r i a l
171
M a n u a l
Tutorial
Math is an important aspect of many Quest3D programs. This tutorial is an
exercise in working with the following channels: Value, Set Value, Expression Value
and Envelope.
..\Tutorials\3.2 Math\Math.cgr
Needed templates:
Step by step:
172
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Press OK to accept.
Drag a Value channel onto the Channel Graph and change its value to 3.
Connect it to the Expression Value channel.
Double click on the Expression Value channel to open its properties
window.
In the Expression field, enter A, referring to the Value attached as a child.
Note that the Current Value now equals 3. Also, the value of the
Expression Value channel is 3.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Select and delete the Value channel connected to the first child link of the Set
Value channel.
Add another Expression Value channel and connect it to the first child link of
the Set Value channel.
Connect the Current Value channel to this Expression Value channel.
Double click on the Expression Value channel to open its properties
window. In the Expression field, type in the following formula: A + 1.
Select the Rename Channel to formula option and press OK to accept.
173
174
Q u e s t 3 D
3 . 0
M a n u a l
Press OK to accept.
Switch to Run Mode.
Move the mouse from left to right. Note the value of the Envelope channel
changes between 0 and 1.0.
Switch to Edit Mode.
Finished scene:
T u t o r i a l
Q u e s t 3 D
3 . 0
T u t o r i a l
175
M a n u a l
For Loop
Just like many other programming languages, Quest3D features a so called For
Loop function. A For Loop executes a specific part of a program a number of
times each frame. Only when all iterations of a For Loop have been executed will
the program continue to the next part.
176
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
In the image on the previous page, Part 1 is processed first. Next, Part 2 is
executed 10 times by the For Loop function. Finally, the program moves on to
Part 3.
A driving simulation might require fifty cars in a scene. Instead of having fifty
seperate car objects, using a For Loop allows you to create a single car object and
render it fifty times, with differences in position, shape, color and even handling.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
177
178
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Max Iterations child of a For Loop channel defines the total number of times
the subprogram is carried out. The Current Iteration Value can be used to create
variations in the various instances in the ForLoop. A simple example is varying
the X coordinate per object instance.
Expressions
The relation between the Current Iteration and the Max Iterations Values can be
used as well. In the image below, the Expression Value (A+1) / B results in a
gradient from 0.2 to 1.0.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Rendering scenes
It is good practice to keep the number of channels in a For Loop routine as small
as possible. Instead of calling a Render complete with Camera and Lights multiple
times per frame, it is better to only loop the objects themselves.
179
180
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
In the image above, the Camera and Light are called once just prior to the For
Loop. The objects are called mulitple times, with variations based on the Current
Iteration Value. Finally, the Light is called one more time to switch it off, so it will
not influence other renders.
Q u e s t 3 D
3 . 0
T u t o r i a l
181
M a n u a l
Tutorial
This tutorial uses a For Loop structure to render a number of cars on screen.
Needed templates:
Step by step:
182
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Press the Animation 3D View tab to examine the scene so far. Note only one
car is visible.
Delete the Val X channel of the cars Position Vector.
Drag an Expression Value onto the template and connect it to the first (free)
child link of the Position channel.
Make a shortcut of the Current Iteration channel and connect it to the
Expression Value channel.
Double click on the Expression Value channel and type in the formula, A *
3. Select the Rename Channel to formula option an press OK to accept.
Right click on the A * 3 channel and choose General Properties. In the
properties window, select the Continuous option. This channel will be
updated multiple times per frame now. Press OK to accept.
Also set the Position, the Motion and the Car channels to Continuous
update. Note that all these channels need to be updated for every instance in
the For Loop. Note after the last is set to Continuous, five cars are displayed
in the Animation 3D View window.
Switch to Run Mode.
Orbit around the cars to examine them.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
From the cars Car 1 surface, delete the R Value of the Emissive Vector.
Add an Expression Value and rename it to Gradient. Connect it to the first
(free) child link of the Emissive channel. Note the color of the cars changes.
Make a shortcut of the Current Iteration channel and connect it to the
Gradient channel.
Make a shortcut of the Max Iterations channel and connect it to the second
child link of the Gradient channel.
Set the Gradient channel and the Emissive and Material channels above it
to Continuous udate.
Double click on the Gradient channel and type in the formula, (A+1) / B.
Press OK to accept. Note the colors of the cars change, from turquoise to
light grey.
183
184
Q u e s t 3 D
3 . 0
T u t o r i a l
Finished scene:
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
185
M a n u a l
3.4 Arrays
Variables can store specific types of information. The most often used types of
variables in Quest3D are value, vector, matrix and text. They can all contain a
single instance of their type. A Value channel for example, can store exactly one
value.
Arrays can store multiple instances of a specific type of information. Each of
these instances or records has a fixed place inside of the array, and may be
accessed using an index value.
Tables
Arrays in Quest3D are always part of a table. Array Table channels need to be
called at least once in a project to initialise. Calling an Array Table continously has
no negative effect on a Quest3D program it is still initialised only once.
The properties window of the Array Table channel allows for adding and
configuring columns.
186
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Column names can be changed at any time they are only used as labels.
Two arrays with the same name are not joined. Avoid duplicate names
at all times to avoid problems.
The Move Up and Move Down buttons affect the order in which the columns
are listed, in both the properties window of the Array Table and the Array
Manager window (described later in this chapter).
Data types
Array columns can store data of several types. Apart from the variable types
mentioned above (value, vector, matrix and text), it is also possible to create an
array of virtually any channel in Quest3D. These are defined by selecting a type
from the Array Channel drop-down list.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Setting Arrays
To store a value in an array, the Set operator of the appropriate type is used. By
linking an index value, the desired record inside the array is specified.
Note that the Array Channel has two child link squares. The first is the index
value. The second can be used to connect a channel of the appropriate type to. Its
children will then be passed along to the Array Channel.
187
188
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Array Manager
The Array Manager in Quest3D shows the content of all arrays in a project, per
table. It can be accessed by pressing the Array Manager tab in the Channels and
Animation Sections, or by switching to the Arrays Section.
One square in the Array Manager is called a record or a field. Records of type
value allow for direct input. Records of type text can be edited either directly
(click once on the T icon), or through the properties window (double click on th
T icon).
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Clicking on other fields will open a properties window of the appropriate type, if
it is available for that channel type.
The order of the columns can be changed in the properties menu of the
appropriate Array Table channel. Clicking the Update Once button will refresh
all displayed columns. Enabling the Auto Update option will result in a constant
refresh.
For Loops
A combination of a For Loop and an array channel is very powerful. The Current
Iteration Value is used as index for the arrays.
189
190
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
191
M a n u a l
Tutorial
Arrays can contain large amounts of data. This exercise shows how the
information in an array is stored and accessed.
Needed templates:
Step by step:
192
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Note there is a table called Menu, which includes a column called Options.
In the first field (row 0) of the Options column, type in Option 1.
Press the New button to create a new record. Type in Option 2 in row 1.
Add two more records, called Option 3 and Option 4.
Finished scene:
If you wish, you can save the current channelgroup to your project directory. The
following steps deal with a new scene.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed templates:
Step by step:
Open the scene Arrays 2.cgr. It contains a number of primitive objects and a
partially configured table.
Drag an Array Value onto the Channel Graph. Double click it to open its
properties window.
From the Table drop-down list, select Objects.
From the Column drop-down list, select Type.
Select the Update channel name option and press OK to accept.
Connect the Objects: Type channel to the first child link of the Object Type
Switch channel.
Make a shortcut of the Current Iteration channel and connect it to the
Objects: Type channel.
Right click on the Object: Type channel and choose General Properties. In
the properties window, select the Continuous update option. Press OK to
accept.
Make sure the Animation 3D View window is open and displays the scene
using the Project Camera.
Press the Array Manager tab. Note the two columns in the Objects table,
Motion and Type.
Enter 1 in the first field (Row 0) in the Object Type column. Note one of the
primitive objects in the Animation 3D View window changes shape.
Enter 2 in the second field (Row 1) in the Type column. Note one of the
objects changes shape.
Fill in values for the other two records as you see fit. (Note: 0 = Box, 1 =
Sphere, 2 = Cylinder, 3 = Cone).
Press the Channel Graph tab.
Drag an Array Matrix onto the Channel Graph and connect it to the Set Matrix
channel. Double click it to open its properties window.
From the Table drop-down list, select Objects.
From the Column drop-down list, select Motion.
Select the Update channel name option and press OK to accept.
193
194
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Add a Value and connect it to the Objects: Motion Array channel you just
created. Rename the Value to Current Object.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
195
196
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Public Channels
Public Channels are channels that can be called from external channel groups.
They are colored red in QueSst3D.
Channels of any base type may be converted into Public Callers. The most often
used types are: Channel Caller, Value, Vector, Matrix, 3D Object, Camera and Light.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Where ever possible, use Public Callers of these types for ease of use and memory
management purposes.
Channels can also be converted into Public Callers manually by selecting Public
Channel Functions > Make Channel Public from the context menu. Alternatively,
the P key may be pressed.
The context menu also provides an option to manually create Public Call
Channels: Public Channel Functions > Convert to Public Call Channel.
197
198
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Functions
Functions are subprograms that may be called using parameters. A type of Public
Caller, they are also colored red in Quest3D.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Parameters are data used as input for functions. They are colored green in
Quest3D.
Channels can be converted into Parameters manually by selecting Public
Channel Functions > Convert to Parameter Channel from the context menu.
Public Channels with Parameter children result in Public Call Channels with
child links of the appropriate type.
Functions may be called as often as needed. Each instance may be supplied with
different parameters, thereby creating variation.
Channel Switches
Functions of type Channel Switch must include an extra Value channel before a
Parameter for the Selector child linked can be connected. This is a result of the
nature of the Channel Switch.
199
200
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
For Loops
Functions may also be called inside a For Loop structure. Arrays may be linked as
parameters to create even more powerful routines.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
201
202
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
Needed Quest3D scene:
Needed templates:
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Import the file Car.cgr from the directory specified above. As pool name,
use Car. The file contains a car model.
From the Groups tab, drag the pool name 3D scene render onto the upper
Channel Graph.
From the Groups tab, drag the pool name Car onto the lower Channel
Graph.
Connect the Car channel in the lower Channel Graph to the Render
channel in the upper Channel Graph.
Click on the Animation 3D View tab. Note a car model is displayed in the
preview window.
Right click on the Current Car Texture channel in the lower Channel Graph
and select Public Channel Functions > Convert to Parameter Channel from
the context menu. Note the channel turns green. Also note the blue Public
Call Channel Car: Car -> Car in the upper Channel Graph now has a child
link of type Value.
Drag a Value onto the upper Channel Graph and rename it to Current Car
Texture. Connect it to the blue Car: Car -> Car channel.
Change the value of the Current Car Texture channel to 1. Note the texture
of the car model in the Animation 3D View is affected.
203
204
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Operators
The so called Operator channels in Quest3D allow you to affect each of these
elements dynamically in real-time.
As a general rule, the base Operator channels in Quest3D are ordered by the
channel type of the result. For example, if the result of an operation should be a
Value, the operator will be found in the Value Operator base channel.
Most of the functions of the Value Operator base channel are used to access
information from other (types of) channels. An example of an often used Value
Operator is Get distance (vector, vector).
205
206
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Vector Operator base channel may also be used to retrieve information from
other (types of) channels. An example is Get Translation (position) from Matrix.
Vector Operators are also used to transform vectors. Transformation may include
basic addition, subtraction, multiplication and division of two vectors. Certain
Vector Operators can be used to set the length of a vector, or multiply a vector by a
value or matrix.
Matrix Operators may be used to turn vectors into matrices, such as Create
Translation Matrix. Matrix Operators can also retrieve information, such as Get
Current Camera Matrix. Matrix Interpolate can be used to blend between two
Matrices.
A special type of Operator is Damping, which exists for Values, Vectors and
Matrices alike. It dampens a variable over time, effectively blending from the
current state to the new. The effect is logarithmic, and its speed may be adjusted
by changing its second child link Value. This damping speed ranges from 0 to
1.0.
Parenting
Normally, the motions of all 3D objects in a scene are relative to the world space
origin (0, 0, 0). However, it is also possible to link certain objects to others. An
object connected to a second object is called a child. The object to which the first is
linked is called a parent.
Linking an object to another object in Quest3D is done by connecting the Motion
channel of the parent to the Parent Matrix child link of the Motion channel of the
child object.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
In the image above, the light cubes position and rotation are relative to the world
origin. In the image below, the light cube is parented to the dark cube. The light
cubes position and rotation are relative to the dark cube.
207
208
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Look At
The fourth child link of a Motion channel is called Look At Matrix. An object can
be pointed in the direction of another object by connecting the Motion channel of
the target to the Look At Matrix. Moving the first object along its local Z-axis
will move it towards or away from the Look At object.
Examples include a camera following a moving car, and a character walking
towards his goal.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Collision Response
The Fast Collision Response channel is a system to simulate collision between
objects. It checks a spheroid at its current position against any number of Collision
Objects, and results in a new position.
Chapter 4.2 describes a more advanced form of collision handling called ODE
(Open Dynamics Engine).
209
210
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The following exercise adds a rotation wheel to a moving car, demonstrating the
concept of parent and child. The Look At function of a matrix is showed using a
camera object.
Needed templates:
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
211
212
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
If you wish, you can save the current channelgroup to your project directory. The
following steps deal with a new scene.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed templates:
Step by step:
213
214
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Make a shortcut of the Motion and connect it to the Get Rotation channel.
Connect the Adjust Heading channel to the Motion channel.
215
216
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Retest the gravity by changing the Y Value of the Position Vector channel
to 2 again. Note the camera drops to the ground once more.
Test the scene by moving around in the environment. Note the camera view
moves in the direction in which it points, and is kept on the ground by
gravity.
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
3.7 Pathfinding
Virtual worlds can be brought to life by adding walking characters or moving
cars. These may be pre-animated, but sometimes a more flexible solution is
needed. Characters might have to stop in front of traffic lights, open bridges or
respond to each other. Pathfinding allows for such dynamic route planning.
Pathfinding depends on a number of waypoints or nodes to be set out in a
virtual environment. Objects can be sent to these nodes directly, or over a
structure of paths. Especially if the environment is complex, setting up a proper
path structure is important.
217
218
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
3D Graph
The nodes of a 3D Graph must be painted onto a collision object. This collision
object can be connected to the 3D Graph channels first child link. The second
child link of the 3D Graph also expects a Collision Object channel. This object is
used to determine line of sight during path calculation.
These two collision objects can be the same. In any case, it is recommended to
keep them as low poly as possible. Often, this means creating a simplified
version of a 3D model for collision purposes.
Motion Planning
The Motion Planning channel has four child links.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The first child link requires the current position of an object with pathfinding. The
second represents the destination position. The third is the Next node range. If
an object comes within this distance of any given node, it will look at the next
node on the calculated route. The fourth is the 3D Graph containing all node and
path structure information.
The position of a node can be requested using a Get Motion Planning Info Vector
channel. It requires the Motion Planning channel as its first child link. The second
child link is a Value that defines which node on the 3D Graph is returned.
An object with pathfinding can be moved towards its goal. See Chapter 3.6 for
more information on moving objects using vectors.
Nodes and paths can be placed and erased in the Nature / Pathfinding Section in
Quest3D.
219
220
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The following exercise will make an animated character find its way between
several waypoints in a city scene.
..\Tutorials\3.7 Pathfinding\Pathfinding.cgr
Needed templates
Pathfinding \ 3D Graph
Collision \ Collision Object
Pathfinding \ Motion Planning
Pathfinding \ Motion Planning Info Vector
Variables \ Value \ Value
Variables \ Matrix \ Matrix Operator
Variables \ Value \ Array Value
Pathfinding \ Triggers \ Vector Proximity Trigger
Variables \ Value \ Set Value
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
connects the two nodes, and a new line is drawn to the current painting
cursor position. Right click to stop painting.
Place a few more nodes in the city scene. Keep the 3D Graph as clean as
possible. An example of a proper Graph can be seen in the image below.
When ready, press the Idle button to exit node painting mode. Note the
Graph disappears.
Tick the Keep showing graph box to make the Graph visible at all times.
221
222
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
223
224
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Finite State Machine channel has a number of child links. Values connected to
the first child link are checked to trigger state changes. Children of the second
child link represent the actual states. Only the current state is called. Finally,
children of the third child link can be triggered once on specific state changes
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The various states of an FSM are represented by blue circular items. The current
state is highlighted. On the right side of the screen, the properties of the selected
state item are shown.
The Channel to call on state drop-down list contains the names of all the
channels connected to the State Call Channels child links of the FSM.
225
226
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The Value channel to trigger transition drop-down list contains the names of all
the channels connected to the State Change Value child links of the FSM.
The Channel to trigger on state change drop-down list contains the names of all
the channels connected to the State trigger channels child links of the FSM.
Hierarchy
In the image below, the current state is Main Menu. Only the 3D Scene and the
Options Menu 1 states can be reached. In addition, the Options Menu 2 state is
only reachable from the Options Menu 1 state. However, from the Options
Menu 2 state it is possible to reach both the Options Menu 1 and the Main
Menu state.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Examples
Other examples in which the Finite State Machine can be used include stages in a
virtual training simulation, advanced character animation setup and behavior of
A.I. characters.
227
228
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The following tutorial shows the workings of the Finite State Machine. It is used
to navigate a menu structure.
Needed channels:
Step by step:
Open the file, Finite State Machine.cgr. It contains a main menu screen and
an option menu screen. It also contains two very simple 3D scenes, namely
one with a red sphere and one with a blue box.
Drag a Finite State Machine channel onto the Channel Graph and connect it to
the Program channel. Note its current value, or state, is 0.
Connect the Main Menu channel to the State Call Channels child link of
the Finite State Machine channel. Note the Main Menu channel is not
called, as no state logic has been defined yet. Also note a new State Call
Channel child link is added to the Finite State Machine, allowing for extra
children of that type.
Connect the Options Menu channel to the second (empty) State Call
Channel child link of the FSM. Note it is not called yet.
Connect a shortcut of the Main Menu Options Menu Button Pressed
channel to the State Change Values child link of the Finite State Machine
channel. Note a new State Change Values child link is added to the FSM,
allowing for extra children of that type.
Connect a shortcut of the Options Menu Main Menu Button Pressed
channel to the second (empty) State Change Values child link of the Finite
State Machine.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Double click on the Finite State Machine channel to open its properties
window. Note the area similar to a Channel Graph on the left and the options
on the right.
Press the New Item button and click once in the middle of the FSM graph.
Note a cicular item is created.
Click on the item to select it. Note its properties are displayed on the right
side of the window. Change its Item name to Main Menu.
From the Channel to call on state drop-down list, select Main Menu. Note
the Main Menu channel is now called, and the main menu screen is
displayed in the Animation 3D View window.
Note the options in this list correspond to the channels connected to the
State Call Channels child links of the FSM.
Create a new item above the Main Menu item and select it. Change its Item
name to Options Menu. From the Channel to call on state drop-down list,
select Options Menu.
Connect the two items by dragging a link from the black dot in the middle of
the Main Menu item to the black dot in the middle of the Options Menu
item. Note the direction of the arrow.
Click on the link to select it. Note its properties are displayed on the right
side of the window.
From the Value channel to trigger transition drop-down list, choose Main
Menu Options Button Pressed. Note the Value of the same name in the
Channel Graph is now called.
229
230
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Note the options in this list correspond to the channels connected to the
State Change Values child links of the FSM.
Drag a link from the Options Menu item back to the Main Menu item.
Select the link and from the Value channel to trigger transition drop-down
list, choose Options Menu Main Menu Button Pressed.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Note the Options Menu Main Menu Button Pressed Value is highlighted,
and the Main Menu Options Button Pressed Value is not.
Connect the Scene Selection Menu channel to the third (empty) State Call
Channels child link of the FSM channel.
Connect the Main Menu Start Button Pressed channel to the third (empty)
State Change Value child link of the FSM channel.
Connect the Scene Selection Menu Main Menu Button Pressed channel to
the fourth (empty) State Change Value child link of the FSM channel.
Open the FSM properties window.
Add a new item, Scene Selection Menu. Set it to call the Scene Selection
Menu channel.
Connect the Main Menu item to the Scene Selection Menu item and set it
to the correct value change.
Connect the Scene Selection Menu item back to the Main Menu item and
set it to the correct value change.
Close the FSM properties window.
Go to the Animation Section.
Switch to Run Mode.
Test the scene by clicking on the functional buttons created so far.
When ready, switch to Edit Mode.
Create Finite State Machine logic for the two 3D scenes. All the needed
channels are already present on the Channel Graph, they only need to be
linked correctly.
231
232
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
233
234
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Not only will this structure help anticipate which elements will be needed, it also
makes it easier to schedule development. Specific team members and clear
deadlines may be assigned to subtasks of the entire project.
Artists may work on importing objects into Quest3D and polishing appearance.
Sound designers may develop or test music and sound routines. Several
specialised programmers may work on their respective subprograms without
hindering each other.
At any point in time during the development process, any of the subprograms
may be updated with a new version provided by the team members working on
them.
Future projects can greatly benefit from a company standard project structure. In
all likelihood, a number of subprograms may be reused. 3D assets may easily be
replaced with new content. Elements such as user interfaces may be kept
consistent in both style and use.
235
236
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The following tutorial is meant to assist in project management. These steps are
not foolproof, as each project has its own unique issues. However, generally
speaking, reading through the points below should be a good exercise.
Step by step:
Take a piece of paper and write down the name of your project.
In one sentence, try to capture the essence of your project. Will it be a
training program? A product visualisation? An architectural walkthrough? A
game? Something else?
Make a rough sketch of the 3D scenes as you envision them.
Make a clear sketch of (or write down notes about) the graphic user interface.
Compile a list of all the needed elements. First concentrate on the basic
subprograms such as environment, camera system and user interface. Next,
make a more detailed list per part, including specific functionality,
animations, textures etc.
Create a back bone structure in Quest3D: based on the various subprograms
create channel groups and link them together. Use clear and consistent
names.
Write down any extra elements you thought of while creating the back bone
structure in Quest3D.
Make a first estimate of how much time it will take to create all the various
elements.
Write down the names of all team members working on the project.
Group the subprograms and 3D assets based on who will be working on
what. Add the numbers and write down the total amount of time needed per
team member.
Think about dependencies between subprograms. Some parts may not be
worked on yet before others are finished. Shuffle the lists where needed to
come up with a sensible schedule.
Discuss the schedule with all team members involved.
If large enough, split the schedule into three or four milestones. These
milestones can also be used in contracts with clients to monitor progress.
Finalise the schedule.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
237
238
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
ODE
Quest3D supports the Open Dynamics Engine (ODE). Physics simulations in
Quest3D are fairly easy to setup, and often produce great and convincing results.
Channels
The ODE Body channel is the heart of any project using dynamics. It replaces the
regular Motion channel structure of an object.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The first child link of the ODE Body channel is the start motion in rest, before the
physics simulation is turned on. A value of 0 or 1 attached to the second child
link disables and enables the simulation, respectively. Real-time dynamics must
be turned on and off per object. A Toggle/FlipFlop template may be used for easy
switching.
ODE Shapes
ODE objects can be assigned one of four simulation shapes: Box, Sphere, Plane
and Polygon Object. Of these, only Box and Sphere are truly dynamic. Plane and
Polygon Object may only be used as static collision objects, such as environments.
Complex dynamics shapes may be approximated by adding several Boxes and/or
Spheres together.
Polygon shapes
An ODE shape of type Polygon Object needs to have a collision object linked to
its third child link.
239
240
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
ODE Properties
The properties window of the ODE Body channel lists a number of attributes.
The properties for all ODE Body channels can also be accessed in the Animation
Section, on the Dynamics tab. ODE attributes may only be edited when the
simulation is off.
A full description of the various properties can be found in the Reference Manual
(press F1 in Quest3D to access it). The three ODE object templates that come with
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Quest3D represent two often used sets of properties: Stable ODE Body, Slippery
ODE Body and ODE Landscape.
ODE Joints
A powerful feature of the Open Dynamics Engine is its joints functionality. ODE
Joint channels can be used to connect several ODE shapes. Only Box and Sphere
shapes may be part of a joint, Plane and Polygon Object shapes may not.
Four types of joints are supported in Quest3D.
Hinge
This joint can be used to simulate a hinging door.
Slider
This joint can be used to simulate a piston or a sliding door.
241
242
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Hinge2
This joint can be used to simulate the suspension of car wheels, including
springs. Axis 1 is used for steering, Axis 2 is used for movement.
Two bodies cannot be connected to each other by more than one joint.
Multiple joints between the same two shapes will contradict each other,
resulting in unstable simulation.
Freedom of movement may be restricted for certain joint types. A slider joint
cannot rotate around its axis for example.
ODE Commands
The ODE Command channel can be used to change a number of simulation
settings, including precision, speed, gravity and friction. The ODE Command
channel may also be used to dynamically apply forces to bodies. These forces may
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
be absolute in world space (wind for example), or relative to the body (rocket
thrusters for example).
ODE Information
The ODE Info Value can be used to retrieve information such as forces, velocities
and joint rotation angles.
243
244
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The goal of this exercise is to gain experience using the physics simulation in
Quest3D. In the first scene, an ODE walkthrough camera system is created. The
second tutorial results in a controllable car.
Needed templates:
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Connect the 'Toggle/FlipFlop' to the Enable Body child link of the ODE
Sphere channel.
Create a shortcut of the Toggle/FlipFlop channel and connect it to the
Enable Body child link of the ODE Environment channel.
Connect the Sphere Motion to the Start Motion child link of the ODE
Sphere channel.
Drag a Null Object onto the Channel Graph and rename it to ODE Sphere
Placer.
Select and delete the Motion folder connected to the ODE Sphere Placer
channel.
Connect the Sphere Motion channel to the ODE Sphere Placer channel.
245
246
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
If you wish, you can save the current channelgroup to your project directory. The
following steps deal with a new scene.
247
248
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed templates:
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
249
250
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Queries
After a MySQL driver connection has been established, the DB Query channel is
used to retrieve and store data. In its properties window, the DB Source must be
set and the query must be given a name. The actual query itself may be entered in
the dialog, or connected as a Text channel to the first child link of the DB Query
channel.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Query parameters
The second child link of the DB Query channel, Input, may be used to add
parameters to the query. The first Input child is referred to as $$1$$, the second
as $$2$$, and so forth.
Examples of often used MySQL commands include:
251
252
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Using a For Loop structure, it is possible to retrieve a set of data and for example
store it as seperate rows in an Array channel of the appropriate type.
ODBC
ODBC in Quest3D work in a way similar to MySQL connections, except for the
fact a connection is made with a driver instead of directly with a database. The
ODBC driver may be set to connect to dBase, MS Excel and MQIS files, as well as
MS Access databases.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
253
254
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
The following steps form an exercise in accessing a remote MySQL database
using Quest3D channels. The second example adds array functionality.
Note: for this tutorial you will need access to a local or remote MySQL server.
The following steps depend on a database named quest3d, containing a table
called player, with columns for id, name and type. For best results, the
table should contain three or more records.
Please feel free to adjust these data to your personal situation.
Needed templates:
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Add another Text channel and connect it to the Username child link of the
DB DriverMySQL channel. Rename this Text channel to User name. Double
click on the channel and change the text to root. Press OK to accept and
close the properties window.
If the server needs a password, add another Text channel and connect it to
the Password child link. Change the text to the password.
Drag a DB Source channel onto the Channel Graph. Double click on the
channel to bring up its properties window. As Name in Quest3D, use
MySQL and select the Rename channel option. Press OK to accept.
Connect the DB DriverMySQL channel to the DB Source channel.
Add a DB Info Value and connect it to the Database Channel Caller. Double
click on the DB Info Value channel to open its properties window. From the
first drop-down list, select the Database Connected option. From the second
drop-down list, select MySQL. Note this is the name of the connection
specified in the DB Source channel. Press OK to accept.
Connect the MySQL channel to the One Time channel.
Double click on the One Time channel to bring up its window. Press the
Reset button to call the channels children. After a few moments, the value
of the DB Info Value channel should change to 1. Close the properties
window of the One Time channel.
Drag a DB Query channel onto the Channel Graph and connect it to the
Retrieve Data channel. Double click the DB Query channel to open its
properties window.
From the first drop-down list, select MySQL.
As the Name of this query, use Get Player Info.
As Actual query, use
SELECT * FROM player
255
256
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Change the value of the Index channel to 1 to request the second record in
the name column. Note the name on screen changes with it.
Finished scene:
If you wish, you can save the current channelgroup to your project directory. The
following steps deal with a new scene.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed templates:
Step by step:
257
258
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
This will add a new record to the player table in the remote database. Note
that $$1$$ refers to the second child link of the Insert Data channel. Press
OK to accept.
Switch to Run Mode.
Press the F4 key to insert a new record to the remote database.
Press the F2 key to reimport the data from the remote database into
Quest3D. Note both left and right columns on the screen in the Animation 3D
View window are updated.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
259
260
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
4.4 Networking
Certain applications might be designed for more than one user. Examples include
virtual chat rooms, team-based training simulations and online multiplayer
games. Each of the users has to run an instance of the application. Each of the
instances needs to continuously communicate its current state. Networking
functionality is used for communication between computers.
Note that Networking is only available in the Quest3D Enterprise and VR
Editions.
In most cases, one of the computers in a network is usually made the server. The
other computers are called clients.
A server handles all data transfer. It receives updates from all clients, and sends
data to each of these clients as well. A server only sends when a client actually
requests data.
Quest3D network applications are set up as regular, single user projects. Clients
run most of the application locally. Only data influenced by other users are
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
requested from the server over the network. Examples include user positions,
avatar appearances and text in chat windows.
Note that a client PC doesnt need to have Quest3D installed. Clients can run
published versions in the form of stand-alone .exe files or .q3d Viewer files.
Usually, the server computer itself is a client as well. If this is not the case, the
computer is called a dedicated server.
The transfer speed is limited by both server and client. Quest3D supports
network applications for up to 32 users. Larger numbers of users are technically
possible, but might result in decreased performance.
Logging in
A client must log in at a server. The server is selected from a list of all running
network applications on a local area network (LAN), or on a specified internet
address (IP number). Generating or updating such a list of available network
programs is called enumerating.
Each network application has a unique ID to ensure clients log in at the correct
program.
Initialisation
After the log-in procedure, the client program is initialised. This may include
setting a start position, changing appearance and setting a role or character type.
In addition, the control over such attributes must be assigned to the newly
logged-in client. User control over scene elements may be shared by changing
assignments dynamically.
Data transfer
Network data can be transferred in Quest3D using the Network Value, Network
Matrix, Network Text and Network Buffer channels. The first three types are
inserted between a parent and its child.
261
262
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Network Values, Network Matrices and Network Texts may be sent and received in
groups. In addition, a transfer guarantee may be set, to make sure data actually
arrives at its destination. This option is slightly slower than regular transfer.
Finally, Network Values and Network Matrices may be set to Continuous
movement, resulting in smoother animation.
Buffers
Channels of other types may be transferred over the network using the Network
Buffer channel. It must be called independently, and the shared channel must be
linked as its child.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Network actions
The Network Actions channel contains a number of functions such as creating and
removing a server, disconnecting a client and setting user control. It also contains
a number of triggers for events such as server creation, client log-in and
connection refusal.
Network information
The Network Info Value channel contains a number of functions such as connection
status, current user number and total number of connected clients.
The Network Info Text channel holds the session and computer names.
Network triggers
Network Triggers can be used to guarantee an event is triggered on all clients.
Regular triggers can be too imprecise for networking purposes.
263
264
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
Network functionality allows for communication between two or more
computers. Network projects in Quest3D are set up as single user programs.
They usually contain code for both server and client.
The following exercise demonstrates creation of and connection to a server in
Quest3D. The second tutorial is an advanced case, showing user control of
variables.
Needed templates:
Step by step:
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
265
266
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Finished scene:
If you wish, you can save the current channelgroup to your project directory. The
following steps deal with a new scene.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Needed templates:
Step by step:
267
268
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The following part of the tutorial requires a second computer which will
function as client. The two computers need to be connected through a local area
network.
From the File Menu, choose Save As. Save the current project to your
project directory.
From the File Menu, choose Publish. Publish the project as a stand-alone
.exe file.
Copy the .exe file onto the client computer.
Run the .exe file on the client computer.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
On the host computer, press the F4 key to log-in as client. Note after a few
moments, the 3D scene is displayed.
On the client computer, test the scene by moving around using the arrow
keys. On the server computer, note the client character walking around.
On the server computer, press the 1 through 4 keys to change the
appearance of the server character. Note the changes are reflected in realtime on the client computer.
Finished scene:
269
270
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Lua functions
Lua channels can have one of two functions, or both.
The first is CallChannel, and is executed when the channel is simply called.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
The second is GetValue, and is executed when the Lua channel is used as a
value. The actual value of the Lua channel itself is equal to the value the script
returns at the end of the function.
Variables
Just like in other programming and scripting languages, variables used in a Lua
script must be declared. This statement assigns memory to the variable. The
word local means that the variable is only used in one particular place, in this
case the Lua channel. As soon as the script is done, the memory is cleared again.
local variable
You can also assign a value to a variable upon declaration.
local variable = 1
Calculations work in a similar way to other programming languages.
variable = variable + 1
Group functions
Quest3D supports the following standard Lua group functions: base, string
and math. In addition, there is a q group containing Quest3D specific
functions.
Two example functions are:
local variable = math.cos(value)
local variable = q.GetTick()
The first example calculates the cosine of the value between the brackets. The
second example retrieves the Tick Count, from the Quest3D Lua group q.
Children
Any number of children of any type may be connected to a Lua channel.
271
272
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
For Loops
Iterative structures, similar to For Loops in Quest3D, can be written using the
following statement:
while i < max do
i=i+1
end
Group loading
Especially useful are the functions to load and unload channel groups. The
statements are:
q.LoadChannelGroup("group.cgr", "PoolName", instance)
q.RemoveChannelGroup("PoolName", instance)
These commands make group management within Quest3D very easy.
More information on Lua in general can be found on the official website:
http://www.lua.org
273
274
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Tutorial
Lua extends the out of the box functionality set of Quest3D channels. The
following exercise aims to familiarise you with the inner workings of the Lua
channel and its two main functions: CallChannel and GetValue.
The second tutorial details a more advanced use of Lua in Quest3D: dynamic
loading.
Needed templates:
Step by step:
Start a new Quest3D project by choosing New Project from the File Menu.
Drag a Lua channel onto the Channel Graph. Note it is automatically set to be
the Start Channel. Double click it to open its properties window. Note the
window already contains script for two functions.
In the GetValue function, declare a new variable by typing in the following
code:
local currentvalue = 1
Set the value of the Lua channel to the value of the variable by replacing the
follow line:
return -1
with
return currentvalue
Press the CallValue button to execute the GetValue function. Note the
actual value of the Lua channel changes to 1.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Add a Channel Caller channel and rename it to Project Start. Set it to be the
Start Channel.
Add a Value channel and connect it to the Project Start channel.
Connect the Lua channel to the Value. The Lua channel is now called as a
value every frame. In other words, the GetValue function of the Lua script
is now executed each frame. Or: the value of the currentvalue variable is
calculated and returned each frame.
Change the script to the following:
function GetValue()
local currentvalue = 1
currentvalue = currentvalue + 1
return currentvalue
end
275
276
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
return currentvalue
end
Press OK to accept. Note the value of the Lua channel is now the same as the
value of its child: 3.
Add another Value channel and connect it to the second child link of the Lua
channel. Change its value to 4.
Change the script so it returns the sum of the values of the two children.
Multiple solutions are possible. One is given below:
function GetValue()
local child0 = channel.GetChild(0)
local value0 = child0:GetValue()
local child1 = channel.GetChild(1)
local value1 = child1:GetValue()
local sum = value0 + value1
return sum
end
Press OK to accept. Note the value of the Lua channel is now 7, the sum of
the values of its two children.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Also note that for simple calculations, the Expression Value channel is easier to
use.
Drag another Lua channel onto the Channel Graph and connect it to the
Project Start channel.
Add a User Input channel and connect it to the Lua channel.
Drag a Channel Caller onto the Channel Graph and connect it to the second
child link of the Lua channel.
Add another Channel Caller and connect it to the first Channel Caller.
Change the script for the CallChannel function so that it only calls the
second child when the value of the first child is equal to 1. It should look
similar to the code below.
function CallChannel()
local child0 = channel.GetChild(0)
local userinput = child0:GetValue()
local child1 = channel.GetChild(1)
if userinput == 1 then
child1:CallChannel()
end
end
Press OK to accept. Note the first Channel Caller is active. This is because of
the GetChild statement in the script.
277
278
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Also note that for simple conditional channel calling, the Quest3D If channel
is easier to use.
Finished scene:
If you wish, you can save the current channelgroup to your project directory. The
following steps deal with a new scene.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Step by step:
Open the file, Lua Scripting 2.cgr. It contains a simple logic structure. Note
the blue Public Call Channel. It reports the error, Not Found. This is correct.
Double click on the Lua: Load Group channel to open its properties. Type in
the following code:
function CallChannel()
q.LoadChannelGroup (Environment.cgr, Environment, 0)
end
This script loads the channel group Environment.cgr into the pool,
Environment. The zero indicates the instance. Press OK to accept.
Switch to Run Mode.
Press the spacebar to load the specified group. Note the environment is
displayed in the Animation 3D View.
Switch to Edit Mode.
Add a line to load the group Character.cgr into the pool Character.
function CallChannel()
q.LoadChannelGroup (Environment.cgr, Environment, 0)
q.LoadChannelGroup (Character.cgr, Character, 0)
end
279
280
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Press the Animation 3D View tab. Note the character is displayed in the
window.
Double click on the blue Character: Character -> Character channel to open
its properties window. Select the Disable Autoload option and press OK to
accept.
Open the Lua: Unload Group channel and type in the following code:
function CallChannel()
q.RemoveChannelGroup (Character, 0)
end
This script unloads the pool, Character. The zero indicates the instance.
Press OK to accept.
Switch to Run Mode.
Press the backspace key to unload the specified group. Note the character
disappears from the Animation 3D View window. Also note the blue
Character channel reports a Not Found error.
Press the spacebar to load the specified groups again. Note the character
reappears, and the blue Character channel is valid again.
Finished scene:
Q u e s t 3 D
3 . 0
T u t o r i a l
Appendices
M a n u a l
281
282
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Modeling tips
Make sure all objects have smoothing applied (even if they don't need it, all
objects must have smoothing group(s) assigned). If you do not apply it
manually, but rely on the automatic smoothing that primitives are created
with, you can't be sure that it will be transferred correctly to Quest3D.
Perform an Attach List to reduce many objects sharing the same material to
one (for example steps of a staircase). This will make it easier in Quest3D if
you decide to change the materials.
Whenever an object is mirrored, you'll most likely need to flip its polygons.
This is only evident when you've applied a ResetXForm and an EditMeshmodifier (as preparation for .X export).
Don't create models where 2 planar surfaces overlap each other with little
height distance. This will cause Z-buffer problems in Quest3D (flickering
when the camera is high above the overlapping surfaces).
Keep in mind that only faces and polygons will be visible in Quest3D. Lines
cannot be exported.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Material tips
No 2-sided materials are allowed. If any objects should be seen from both
angles, make a clone of the object with flipped polygons and attach it to the
original.
Always use the standard 3DSMax-material.
Materials with Wire set to on are useless in Quest3D. If you want to create
thin objects (such as rope or wire), you must model them using conventional
geometry.
Keep in mind that only objects mapped with the UVWmap-modifier or the
UnwrapUVW-modifier are correctly exported to .x. Don't use the mapping
features in the material editor (scale, crop etc.) as they're not exported.
Texture tips
Keep all the textures that you use in a given 3DSMax scene in the same
folder. When you import an .X file in Quest3D, it will scan the folder looking
for the scene textures, so make sure to export your .X scene to the folder
where your textures are located.
Dont use JPG textures with less than 8x8 pixels. This will make DirectX
crash.
For non-transparent objects, use JPG textures (or DDS textures if your target
platform has graphics cards that support this). Texture sizes must adhere to a
power of 2, meaning that 8, 16, 32, 64, 128, 256, 512 pixels are all valid sizes.
1024 & 2048 pixels are also allowed if the graphics card supports it (most
modern cards do that)
Keep in mind that the difference between a 512x512 texture and a 1024x1024
texture is 1:4, so the last-mentioned texture takes up 4 times as much
memory of your graphics card than the smaller one. If you use textures that
don't adhere to the power of 2-rule, Quest3D will automatically convert them
by rounding up (i.e. a 768x972 texture will be converted to a 1024x1024)
texture.
For a transparent object, you can use one TGA (32-bit with alpha-channel
included) or 2 JPGs (where the second holds the alpha channel information)
or 1 PNG file. Keep in mind that TGAs are the better choices because they
can be mipmapped (as opposed to using two JPGs).
For transparent objects, you can also use a DDS with an alpha channel. If you
pre-generate the MIP maps in Photoshop, your Quest3D project will start up
faster: normally, all textures that have mipmapping enabled will have their
mipmaps generated upon starting up the application. With DDS you can do
this in advance.
283
284
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Maya
Quest3D ships with .X Exporters for Maya up to version 6. There are several ways
to install an .X exporter for Maya. You can use the way descripibed below or you
can install the Microsoft DirectX 9.0c SDK.
The Microsoft DirectX 9.0c SDK can be downloaded from the following page:
http://msdn.microsoft.com/directx/
We recommend using the exporter from Microsoft, if needed, follow these steps
for the installation and usage of the Maya 5 exporter. The steps also apply for
older versions.
The following instructions are taken from the Readme.txt file, and revised.
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
File Options deals with the way the file is constructed. Ascii will do fine.
Tesselation Options only apply if you use Nurbs or Subdiv patches. It is
recommended not to use these settings, but to convert all objects to polygons
first. The result will be more accurate and predictable because of the control
you have with the regular converting tools.
Material Options deal with the textures. You can flip the U/V coordinates,
and make the texture path relative or absolute. If you don't have textures,
you can turn the Export Materials option off.
Animation Options let you control the way in which the movement is
exported. If you export the keyframes only, Quest3D will re-calculate the
inbetweens. If you export every frame, the file will be much larger but more
accurate.
Skinning options apply if you have a skinned character. If you don't use
bones, you can turn the Export Skinning option off.
Click on Export All. A file dialog appears. Specify the filename and click on
Export. The x file will be created, and you can import it in Quest3D.
285
286
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Right-click
Press and hold the left button
Drag the mouse
Drag from a to b
Select an item
Deselect an item
Multi-select items
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
287
288
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
A3 Keyboard shortcuts
F1
F2
F3
F4
F5
F6
Control C
Control X
Control V
`
Spacebar
Backspace
Pause Break
Help
Channels Section
Animation Section
Object Section
Arrays Section
Nature / Pathfinding Section
Copy channels
Cut channels
Paste channels
Create channel shortcut
Create / explode folder
Level up
Toggle Run / Edit Mode
Q u e s t 3 D
3 . 0
T u t o r i a l
Glossary
M a n u a l
289
290
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
291
292
Q u e s t 3 D
dragging, 19
Edit, 75, 81, 117, 118, 123, 128, 129,
150, 151, 152, 161, 162, 172, 173,
174, 183, 214, 215, 222, 230, 231,
245, 246, 249, 257, 258, 265, 279,
282, 287, 288
Emissive, 73, 74, 77, 90, 107, 123, 183
Enterprise, 61, 233, 250, 254, 260,
264, 267
envelope, 73
Envelope, 78, 79, 82, 83, 85, 142, 146,
151, 152, 169, 171, 174
Envelopes, 78, 83, 139, 141, 142, 169,
170
exe, 11, 13, 61, 62, 63, 64, 65, 67, 261
Executable, 64, 65
exporter, 87, 284
Expression Value, 167, 171, 172, 173,
181, 210, 213, 265
Expressions, 168, 178
Finished scene, 48, 53, 60, 77, 86, 90,
105, 113, 117, 119, 124, 129, 137,
142, 150, 152, 163, 174, 184, 192,
195, 204, 212, 216, 223, 232, 247,
249, 256, 259, 266, 278, 280
finite state machine, 224
Finite State Machine, 54, 153, 224,
225, 227, 228, 229, 230, 231, 232
Fog, 2, 116, 132
folder*, 48, 60, 63, 64, 65, 90, 93, 101,
102, 103, 118, 122, 123, 135, 245,
283, 284, 287, 288
for loop, 175
For Loop, 3, 153, 175, 176, 178, 179,
180, 181, 182, 189, 200, 252, 257
For Loops, 189, 190, 200, 273
frame, 51, 52, 82, 83, 85, 121, 132,
148, 150, 153, 175, 176, 179, 181,
182, 275, 285
framerate, 51, 109, 121, 123
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
293
294
Q u e s t 3 D
3 . 0
T u t o r i a l
M a n u a l
Q u e s t 3 D
3 . 0
T u t o r i a l
Template list, 17
templates, 9, 21, 54, 55, 57, 83, 89,
111, 114, 117, 118, 128, 135, 141,
147, 151, 159, 171, 181, 191, 193,
202, 210, 213, 220, 237, 240, 244,
248, 254, 257, 264, 274
Templates, 3, 5, 9, 19, 21, 25, 54, 57,
58, 68, 69, 121, 134, 287
texture, 14, 69, 71, 72, 73, 74, 75, 77,
87, 91, 92, 93, 94, 95, 96, 97, 100,
101, 102, 103, 108, 110, 112, 113,
131, 134, 135, 136, 194, 200, 203,
283, 285
Texture, 54, 73, 74, 75, 76, 95, 96, 97,
101, 102, 103, 104, 110, 112, 134,
135, 136, 187, 192, 194, 203, 283
Texture Blend Factor, 73, 74
textures, 72, 74, 75, 91, 92, 93, 94, 97,
99, 101, 121, 131, 135, 139, 194,
236, 283, 285
Time based state changes, 227
Time Slider Bar, 82, 84
Timer, 55, 78, 79, 80, 82, 83, 84, 148,
149, 211
Timer Commands, 79, 83
Toggle/FlipFlop, 239, 245
Toolbar, 16, 23, 59, 75, 81, 287
transparency, 69, 72, 74, 75, 77, 78,
90, 91, 95, 96, 99, 100, 101, 131,
134, 138
Transparency, 72, 75, 77, 95, 96, 103,
104
transparent, 283
trees, 101, 104, 132, 137
Triggers, 155, 156, 220, 244, 263
tutorial, 1, 8, 23, 48, 57, 63, 76, 83, 88,
101, 122, 159, 171, 181, 223, 228,
236, 244, 254, 264, 274
Tutorial, 23, 44, 53, 57, 63, 76, 83, 88,
101, 111, 117, 122, 128, 135, 141,
M a n u a l
295