The Reality of Virtual Environments: Jean-Christian Delannoy
The Reality of Virtual Environments: Jean-Christian Delannoy
The Reality
of Virtual
Environments
Jean-Christian Delannoy
puter models and environments are commonly used in
design, manufacturing, simulation, and entertainment.
These virtual environments (VEs) are often
successful at appearing
realistic when time
remains still, but as the
mobile objects are set into
motion and interact with
their surroundings, the movements often appear unnatural.
In many prerendered VEs
used for entertainment purposes, all of the objects
motions must be handmade
by 3-D animators in a process
that is time consuming and
lacks strict realism. In other
VEs such as the first generation of 3-D video games,
objects are modeled by their
bounding space or by a
sphere that surrounds all of
the 3-D models vertices. In
these cases, the motions are often quite
linear, and the collision response algorithms are quite simplistic; some even
revert to stopping an objects motion
when it collides with the environment.
These techniques are much too minimal and greatly reduce the level of
realism in VEs.
Letting animations follow their own
physics is quickly becoming the new
recipe for realism as new techniques for
modeling and animation based on the
laws of classical mechanics are emerging in all virtual reality applications.
AUGUST/SEPTEMBER 2005
ponents through the center of mass modify the linear velocity whereas the
remainders will modify the angular
velocity of the object in question.
These principles can be programmatically applied to the virtual world efficiently. During every program loop, whenever
a force is applied to an object it is decomposed into the component that modifies
the linear velocity and the component that
modifies the angular velocity; these forces
are added to two resulting vectors representing the sum of all the linear forces
and the sum of all angular forces on the
object. At the end of each program loop
when all of the forces have been added to
all of the objects in the VE, the total linear
and angular forces are used to obtain the
linear and angular accelerations of the
37
Object.TotalForce = (0,0,0);
Object.TotalTorque = (0,0,0);
center. Collisions occur whenever the distance between the center of two objects is less than or
equal to the sum of the radii of
the two objects. The collision
normal is the normalized vector
going from the center of one
object to the other.
Object.ApplyForces();
TotalForce += Force * R;
TotalTorque += Force R;
+
+
OBBs, 3-D boxes that rotate
m1 v1 + m2 v2 = m1 v1 + m2 v2 s. (1)
when the model rotates. Detecting a colbe one; in a perfectly inelastic collision, it
lision with these shapes is more involved
will be zero since all energy will be lost.
The elasticity of collision law accounts
than it was with spheres. Here is the
Before any processing can be done to
for the amount of energy lost during the
sequence of events when verifying for
handle a collision, the collision itself must
collision. This elasticity is necessary since
collisions of object A against object B:
be detected. This is dealt with in a hierarimpacts in reality will create deformations
For every set of four neighboring
chical manner: collision detection using
on the colliding objects, whereas in our
coplanar vertices of the OBB of object
spheres and, if the result of the sphere test
simulation the objects are rigid and dont
A, set up a plane equation (Ax + B y+
was positive, collision detection using orichange shape at all. The simulation relies
C z + D = 0) with the normal heading
ented bounding boxes (OBBs), a set of
on an empirical relation to quantify the
outward.
polygons that encapsulate the 3-D model
energy lost during the impact. Its com For every edge of object B, check if
more accurately than the sphere. The OBB
puted by dividing the difference between
the line intersects with any of As planes.
will move and rotate along with the 3-D
the velocities of both objects after the col If an intersection point is found, see
model it represents in the collision world.
lision by the difference in velocity of both
if the intersection point is on the polygon
The collision response can also be
objects before the collision. The coeffiand not just on the plane. (A plane
thought of as consisting of two parts: the
cient of restitution is a value between 0
ranges from negative to positive infinity,
linear collision response, dealing with
and 1 and represents the amount of enerand a polygon is limited in its bounds.)
the linear velocities of objects, and the
gy lost during the collision
If the intersection point is on the
angular
collision
response,
dealing
with
(v 1+ v2+ )
polygon, there is a collision.
the angular velocities of the objects.
e=
.
(2)
(v 1 v2 )
The collision normal is the normal
When dealing with linear collision
of the traversed plane.
response, the collision detection algoThe collision detection routine consists
rithm will only need to supply the normal
No energy is lost in a perfectly elastic
of two hierarchical levels. Collision detecof the collision plane upon detecting a
collision, so the restitution coefficient will
tion with spheres is done first since it is
collision. During a collision, the two colquick and provides a good estimate; if a
liding objects wont undergo any modificollision is detected with the spheres, then
cation to their momentum that is orthogoTop
the second level of collision detection is
nal
to
the
collision
plane;
so
the
speed
Front
done with the OBBs method. The OBB
used in both the elasticity and momencollision detection involves much more
tum equations will be the speed of the
logic and calculations than the sphere colobject along the collision normal; the
lision test but is also much more precise.
component of the velocity that is orthogCreating a hierarchical collision detection
onal to the collision normal will not be
Right
routine provides the best of both worlds,
affected. When dealing with both linear
efficient and precise results, since the
and angular collision response, we will
heavier OBB collision detection routine is
need to know the normal of the collision
only called when two objects are near.
plane and also the point of collision.
Force Location and Orientation to Create
Object.Velocity += Acceleration * TimeElapsed;
Object.AngularVelocity += AngularAcceleration * TimeElapsed;
38
Collision response
IEEE POTENTIALS
(3)
J n
m1
v2 = v2 +
J n
.
m2
Normal
1 =
I1
J (r 2 n)
2 =
2
.
I2
v1 = v1 +
(7)
(8)
Applicability
Virtual reality applications used in
domains such as medicine and entertainment benefit greatly from more accurate
representations of real-world phenomena;
e.g., the aerospace industry can build
entire aircraft without requiring a physical
prototype. Instead, a virtual model is built
and undergoes tests in physically driven
VEs at a fraction of the cost of building a
prototype. By using characteristic equations from the environment, the reactions
of the objects are not only much more
believable but custom programming is
not needed for any single case.
AUGUST/SEPTEMBER 2005
Collision
(4)
(5)
Collision Plane
39