README - BallHitsWall1
~ tutorial
Toolkits demonstrated: Collision
last updated: June 22, 2000


Overview:

BallHitsWall1 uses the Collision Toolkit alone, without the Dynamics 
Toolkit. The scenario: a ball is thrown at a wall, bounces off the 
wall, bounces off the floor, and then exits the scene. The motion of
the ball is not being driven by the dynamics engine, rather, it is 
scripted by hand.

Note: There is no gravity in this simulation.


Hardware requirements:

PII 300MHz, 3d acceleration
Windows98 / Win2000 / WinNT / Linux / Irix / Playstation2
 



    


Keyboard controls:

Key             Playstation 2           Action
---------------------------------------------
<Enter>         Start                   reset the simulation
<Space>         Square                  throw the ball


This program uses the MathEngine Viewer. Please see the MathEngine Viewer 
Developer's Guide for more information if desired. Controls are:

Key                     Action
------------------------------
cursors                 move camera
ctrl+cursors            move light
F1                      Application-specific Help
F2                      change shade model
F3                      toggle texture
F4                      toggle axis display
F5                      toggle stats display
F6                      toggle text
F7                      toggle camera info
F8                      toggle display lists
F9                      toggle fullscreen
F10                     toggle pause
F11                     toggle mouse manipulation
F12                     toggle renderer help
<Esc>                   quit


Mouse Controls:

Mouse controls          Action
------------------------------
drag in center          orbit camera
drag near left edge     pan camera up/down
drag near bottom edge   pan camera left/right
drag near right edge    pan camera towards/away
drag near top edge      zoom camera in/out
SHIFT + pick graphic    translate object left/right and up/down
CTRL + pick graphic     translate object towards/away
ALT + pick graphic      rotate object


Discussion:

The motion is controlled by a very simple physics algorithm in 
BallHitsWall1.c itself. This program demonstrates how to use the 
Collision Toolkit to perform some basic tasks:

- Obtaining collision events.
- Identifying them (ball-wall collision vs. ball-floor collision).
- Calling the intersection function.
- Reading contact data structures.

The code for the motion algorithm shows you how to extract 
information from the contact data structures and how to use 
this information to produce appropriate changes in the motion 
of the rendered models - in this case both bouncing off the 
wall and floor. 

The program also shows how the new positions computed from the 
motion algorithm are used to update the coordinate systems for 
both the collision model and the rendered model.

Additionally, by changing one line of code, we can switch from 
sphere behavior to cube behavior. The collision will then produce
four contacts instead of just one.


Please direct any questions or comments regarding MathEngine 
Example Programs and Tutorials to support@mathengine.com .

======================================================================

(c) Copyright MathEngine PLC 2000. All rights reserved. 

Printed in Canada.

http://www.mathengine.com
