The research and application of the collision detec tion algorithm in the
virtual simulation system
Li Panpan, Shan Liang
*
, Su Zhiyong
Institute of Automation, Nanjing University of Science and Technology, Nanjing 210094
E-mail: shanliang@njust.edu.cn
Abstract: With the development of simulation technology, computer software and hardware technology, three-dimensional virtual
simulation has been widely used in many fields. Based on Visual Studio2008 software platform and OpenSceneGraph three-dimensional
scene rendering engine, this paper programs and achieves a process in which the moving car runs on the rough terrain in a virtual simulation
environment. This paper designs the collision detection algorithm to deal with the collision problem about the car and the three-dimensional
terrain. The simulation shows that the designed collision detection algorithm can obtain good results.
Keywords: the virtual simulation, OpenSceneGraph, the collision detection algorithm
1 Introduction
With the development of computer hardware, software
and the simulation technology, the virtual simulation system
has been applied in many fields. For example, the new
method for preliminary shipbuilding feasibility stud y was
provided by the accurate and vivid three-dimensional virtual
simulation platform o f Ship Dynamic Positioning System
[1]
.
Manufacturing problems can also be timely found so that the
production can be optimized with improving the efficiency
and reducing the cost
[2]
. Virtual simulation technology is of
great importance for the teleoperation of lunar rovers during
the exploration phase, as well as the design of locomotion
systems, performance evaluation, and control strategy
verification during the R&D phase
[3]
. Although the
reliability depends on the degree of approximation, the
virtual simulation can yet be regarded as an efficient method
due to the low cost, low risk, high efficiency, short cycle,
repeatability and the like.
The collision detection is essential in the virtual
simulation system. Its timeliness and accuracy directly
influence the user’s sense of reality and immersion. As a
result, many scholars have paid attentions to this area and
made lots of great progresses in recent years. Some
proposed detection algorithms
[4,5]
are still the primary
methods because of their great influences in relevant fields.
Now, there are many kind s of useful collision detection
algorithms
[6,7]
, but the suitability of each algorithm is strictly
limited. So different algorithms are needed according to
different requirements and none algorithm can be applied in
every situations.
As an open source and high-performance development
library, OpenSceneGraph (OSG) mainly provides the scene
graph management and graphics rendering optimization for
the graphics applications and is commonly used in video
games, virtual simulations, virtual realities, science
engineering virtualization and so on. OSG is also highly
evaluated for its powerful functions, favorable development
pattern and strong portability. Since OSG has the advantage
of high performance, solid codes, portability, extensibility,
low-cost, open-source, etc.
[8]
, it has solved the cost problem
and promotion problem in underlying graphics engine, like
OpenGL and other commercial engine like OpenGVS and
*This work was supported by the national natural science foundation of
china (No. 61203009, No. 61300160)
Vega. Consequently, there are many OSG-based
applications such as virtual sea battlefield, dynamic infrared
scene simulation system, missile attitude control association
simulation system.
After introducing the general structure of collision
detection, a new collision detection algorithm is pro posed to
avoid the collision between the moving car and static terrain.
This algorithm chooses six points to determine the
intersections with the terrain through the ray detection
algorithm. With the further processing of these intersections,
the car position and attitude can be changed when it is
moving in the rough road. Based on Visual Studio 2008,
OSG and Win32 Console, the paper programs and achieves
the moving process of the car on the virtual rough terrain,
and solves the pr oblem of collisions between the moving car
and the static terrain.
2 An overview of the collision detection
algorithm
In virtual reality and simulation system, it is impossible
for collisions between o bjects and objects or objects and
environments. Besides, two impenetrable objects in the real
world cannot share the same space in the virtual simulations.
Thus, in order to keep the realness o f the scene, collisio ns
should be detected and processed in time. Otherwise, objects
may impenetrate other ones or fly out of the ground, which
will negatively effect the immersion and interaction of
virtual scenes. The process is called collision process. The
collision process is consisted of collision detection, collision
confirmation and collision response: The collision detection
is used to determine whether there is a collision between two
objects or more objects; the collision confirmation is aimed
at finding the intersecting position p oint among objects or
between objects and environment; and the collision response
intends to take measures to make the impacted object d o the
right action. The who le collision process is shown in
figure.1.
Figure.1:The schematic flow diagram of collision processing
Proceedings of the 33rd Chinese Control Conference
Jul
28-30, 2014, Nan
in
, China
6417