Java Reference
In-Depth Information
Figure 6. Navigating icons
or orientation necessary for the view platform and human body. Note that this may
involve the detection of collision detection events. For the application, movements in
four directions, forward, backward, shift left or right may generate collision events.
When one of these has occurred, anti-collision will be activated. This may result in
a movement, which is opposite to the one specified by the user. Further discussion
on the implementation of collision detection in the Java 3D application is given in
the next section.
collIsIon detectIon behavIor
To achieve realistic navigation in a 3D environment, the use of collision detection is es-
sential to guarantee that the viewing platform or user does not traverse any solid object.
The Java 3D API provides only two event conditions, WakeupOnCollisionEntry and
WakeupOnCollisionExit, for detecting collisions. There is no provision on follow-up ac-
tions when these events occur.
As given in Appendix G, a custom collision detection conditions has been designed
and developed to provide better support for post-collision processing in the 3D virtual
laboratory application. Specifically, a cylinder with appropriate height and radius is used
to represent a human body, and this is used to detect collision with objects in the 3D virtual
scene. Once the cylinder collides with geometric objects such as virtual instruments, doors
or walls, a collision event is generated for post-collision processing so that the user will be
prevented from making any further offending movement.
Figure 7 shows the flow chart for post-collision processing. Note that since collision
occurs only when the movement is forward, backward, left or right, the processing is only
restricted to these four kinds of movements. Also, to make the effect of collision as obvious
to the user as possible, a significantly larger incremental movement in a direction opposite
to the current movement is used when there is a collision.
Search WWH ::

Custom Search