Better than
your average arcball.
The first thing that most designers do when
starting a Cult3D project is to add an arcball.
With a few modifications the standard acrball
can offer the end-user a great amount of control,
while at the same time being very easy to
use for the 3d novice.
In this tutorial we will examine three different
arcball configurations.
The first will probably find it's way into
most of your Cult3D projects; it is ideal
for object-based presentations.
The second example is more than just an arcball
configuration, it is a full walkmode based
on navigation from games such as Quake2 and
Half-life. It combines a customized arcball
cobined with keypress animations to create
an easy to use navigation mode.
The last is fairly simple example of how
to use an arcball to create panoramic image
presentations with Cult3D.
Creating a
more controlled arcball.
Whereas the
standard arcball is great for objects that
float in space, objects that are meant to
be grounded on a surface (ie. an object with
a shadow or ground plane) don't react so well
to being flipped upside down.
Follow these
steps to create an arcball interface that
gives the end-user the sense that the object
is truly grounded.
Make sure you
have downloaded the project files from the
link at the top of the page.
In the Cult3D
Designer:
1. Open the
Project named 'arcball-control.c3p'
This is a fairly
common file setup. There is a camera aimed
at the center of the object (Camera01), and
all the geometry has been parented to a dummy
object (scenemaster) that was placed in the
desired center of rotation.
Instead of just
applying an arcball to the dummy object, do
the following:
2. In the Scene
Graph, right click on the 'scenemaster' dummy
object and select 'New... Dummy'. This will
create a new dummy object placed at the same
point as the original scenemaster object.
(Figure 1)
3. Right click
on the new Dummy object and select 'Change
Name', rename the dummy to 'cameramaster'
4. Drag the
cameramaster object onto the 'RootNode' in
the Scene Graph. This will change the hierarchy,
making the Dummy a child of the RootNode instead
of the scenemaster object. (Figure
02).
5. Drag the Camera01 object onto the cameramaster
object, your hierarchy should now appear as
in figure 3.
Now our camera is actually parented to a
dummy placed in the desired center of rotation
for the scene. Now we will add the arctual
arcball elements that will create the navigation
mode.
1. Drag a new World Start event into the
Event Map. (Figure 4)
2. From the Object Motions section of the
Actions window, drag an Arcball action onto
the WorldStart_1 event. Repeat this two more
times so that there are a total of three arcballs
attached to the event. (Figure 5)
3. From the Scene Graph, drag the cameramaster
object onto each of the first two arcballs.
Drag the actual camera object onto the third
arcball. Your setup should look like Figure
6.
4. Open the details window for the first
arcball. Alter the default parameters to match
the following:
Coordinate System: Local Frame
Use Local Pivot Position : ON
LEFT button : Rotate Z
RIGHT button : NONE
MIDDLE button : NONE
Keep Rotating : ON
Friction Duration : 1000 ms
It should ressemble Figure 7.
5. Open the details window for the second
arcball. Alter the default parameters to match
the following:
Coordinate System: Camera Frame
Use Local Pivot Position : ON
LEFT button : Rotate X
RIGHT button : NONE
MIDDLE button : NONE
Keep Rotating : OFF
Friction Duration : N/A
It should ressemble Figure 8.
6. Open the details window for the third
arcball. Alter the default parameters to match
the following:
Coordinate System: Camera Frame
Use Local Pivot Position : ON
LEFT button : NONE
RIGHT button : Translate -Z
MIDDLE button : Translate -XY
Translation sensitivity: X=50, Y=50,
Z=50
Keep Rotating : OFF
Friction Duration : N/A
It should ressemble Figure 9.
If you press 'Play' in the preview window,
you navigation should be smooth and easily
controllable. Event though the object can
be flipped over, it does appear 'grounded'.
Check out the final scene here.
Creating a
walkmode
More and more designers are looking to Cult3D
to create virtual walkthroughs. Here are instructions
on creating a first-person shooter - like
walkmode.
In the Cult3D Designer:
1. Load the project 'arcball-walk.c3p'
2. In the Scene Graph, Right click on the
'Camera01' object and select 'New...Dummy'.
This will create a new dummy object at the
same position as your camera.
3. Right click on the new dummy and rename
it 'cameramaster'.
4. Drag the cameramaster object onto the
RootNode of the Scene Graph. Drag the Camera01
object onto the cameramaster object. Your
final hierarchy should appear as in Figure
10.
5. In the Event Map, create a new World Start
event and attach two 'arcball' actions to
it. (Figure 11)
6. From the Scene Graph, drag the cameramaster
object onto the first arcball, and the Camera01
object onto the second arcball. ( Figure 12).
7. Open the details window for the first
arcball. Alter the default parameters to match
the following:
Coordinate System: Local Frame
Use Local Pivot Position : ON
LEFT button : Rotate Z
RIGHT button : NONE
MIDDLE button : NONE
Keep Rotating : ON
Friction Duration : 1000ms
It should ressemble Figure 13.
8. Open the details window for the second
arcball. Alter the default parameters to match
the following:
Coordinate System: Camera Frame
Use Local Pivot Position : ON
LEFT button : Rotate X
RIGHT button : NONE
MIDDLE button : NONE
Keep Rotating : OFF
Friction Duration : N/A
It should ressemble Figure 14.
If you press 'play' in the Preview window,
you will now be able to look around your scene.
The next step is to let users move around
the space. Will will do this with a series
of Keypress actions.
1. Drag a new 'Keyboard's Key Press' event
into the Event Map. Rename this event 'start_move_forward'.
2. Drag a new 'Keyboard's Key Release' event
into the Event Map. Rename this event 'stop_move_forward'.
3. From the Object motion section of the
actions window, drag a Translation XYZ action
onto the start_move_forward event.
4. From the object motion section of the
actions window, drag a Stop.. action onto
the stop_move_forward event.
5. Drag the cameramaster object onto each
of the TranslateXYZ and Stop.. actions. You
Event Map should ressemble Figure 15.
6. Open the details window for the Translation
XYZ action and enter the following values.
Z: -20, Time : 200
Loop : ON
7. Now open the details window for the Stop...
action. From the 'Available motions' column
select 'start_move_forward.Translation' and
press the right arrow button. This should
move the action into the 'motions to be halted'
column. Make sure that 'Stop all accumulated
motions' is checked.
8. Open the parameters dialogue box for the
start_move_forward event. From the left column
select the 'Arrow Up' key and press the 'add'
button. Repeat these steps for the stop_move_forward
event.
If you press the 'play' button in the Preview
window you should be able to move through
the space by pressing the Arrow Up key and
turning with your mouse button.
Next we can activate the rest of our arrow
keys to allow users to move backwards as well
as step left and right.
Repeat the steps above to create the following
events and actions.
Keyboard's Key Press: start_move_backwards
Parameter : Arrow Down
actions:
Translation XYZ
Parameter: cameramaster
Z: 20 , Time : 200
Loop: ON
Keyboard's Key Release: stop_move_backwards
Parameter : Arrow Down
actions:
Stop..
Parameter: cameramaster
motions to be halted: start_move_backwards
stop accumulated motions: ON
Keyboard's Key Press: start_move_left
Parameter : Arrow Left
actions:
Translation XYZ
Parameter: cameramaster
X: -20, Time : 200
Loop: ON
Keyboard's Key Release: stop_move_left
Parameter : Arrow Left
actions:
Stop..
Parameter: cameramaster
motions to be halted: start_move_left
stop accumulated motions: ON
Keyboard's Key Press: start_move_right
Parameter : Arrow Right
actions:
Translation XYZ
Parameter: cameramaster
X: 20, Time : 200
Loop: ON
Keyboard's Key Release: stop_move_right
Parameter : Arrow Right
actions:
Stop..
Parameter: cameramaster
motions to be halted: start_move_right
stop accumulated motions: ON
By pressing 'play' in the Preview window,
you should be able to fully navigate the space
using the arrow keys and the mouse in combination.
You should have 8 key-based events in total
as per Figure 16.
Optionally you can set up the left and right
arrow keys to make the camera rotate if you
desire.
Check out the final scene here.
Creating a
panoramic camera
Because of Cult3D's excellent image compression
technology, it is an excellent tool for creating
panorama based presentations. Designers can
quickly create an arcball implementation that
duplicates typical panoramic presentation
interactivity.
In the Cult3D Designer.
1. Load the project 'arcball-pano.c3p'.
This scene consists of an inside out sphere
with a panoramic texture applied to it. At
the center of the sphere is a camera.
2. In the Scene Graph, right click on the
Camera01 object and select 'New... Dummy'.
3. Rename the new dummy 'cameramaster'.
4. Drag the cameramaster object onto the
Rootnode in the Scene Graph.
5. Drag the Camera01 object onto the cameramaster
object. Your hierarchy should ressemble Figure
17.
6. Create a new World Start event. Attach
three arcballs to the new World Start event.
7. Attach the cameramaster to the first two
arcballs and the Camera01 object to the third.
(Figure 18).
8. Open the details window for the second
arcball. Alter the default parameters to match
the following:
Coordinate System: Local Frame
Use Local Pivot Position : ON
LEFT button : Rotate Z
RIGHT button : NONE
MIDDLE button : NONE
Keep Rotating : ON
Friction Duration : 1000ms
9. Open the details window for the second
arcball. Alter the default parameters to match
the following:
Coordinate System: Camera Frame
Use Local Pivot Position : ON
LEFT button : Rotate X
RIGHT button : NONE
MIDDLE button : NONE
Keep Rotating : OFF
Friction Duration : N/A
10. Open the details window for the second
arcball. Alter the default parameters to match
the following:
Coordinate System: Camera Frame
Use Local Pivot Position : ON
LEFT button : NONE
RIGHT button : TRANSLATE -Z
MIDDLE button : NONE
Translation sensitivity:
X: 25, Y: 25, Z: 25
Keep Rotating : OFF
Friction Duration : N/A
Pressing 'play' in the preview window should
now allow you to interact with the panorama
in a fashion similar to most other panoramic
software.
Check out the final scene here.
Final words
These are only three of the many possible
implementations of the Cult3D arcball. With
a little experimentation you can achieve just
about anything you might want.
|