
本科生毕业论文(设计)
题 目 基于 Unity3D 的车辆驾驶模拟
学 院 计算机学院
专 业 计算机科学与技术
学生姓名
学 号 年级
指导教师
二Ο一六年五月十七日

四川大学本科毕业论文 基于 unity3D 的车辆驾驶模拟
1
基于 unity3D 的车辆驾驶模拟
计算机科学与技术
学生 指导教师
[摘要]道路交通虚拟仿真系统,利用计算机三维图形即时生成技术,模拟道路交通场景,让
使用者在虚拟的驾驶环境中,能够体验到与真实环境极其接近的效果。依据国内交通驾驶规则,对
车辆模拟驾驶和用户以及车辆基本信息管理模块进行设计与开发,并对这两个部分进行详细的阐述。
以当前道路交通虚拟仿真技术背景和行业发展前景为开始,通过对涉及到的两个模块的功能需求分
析,结合现有的可使用的三维图形处理技术,对系统的实现给出具体的设计思路,并对其进行详尽
的阐述;接下来会对系统的各功能具体实现方式进行详细的说明,并对过程中会使用到的一些工具
进行简单的介绍;系统各功能的具体实现细节将作为下一个要重点阐述的内容,包括代码实现技术、
场景设计流程、系统运行效果展示以及部分功能的测试情况等。最后对系统设计进行了大概技术总
结,给出了系统设计的优劣分析以及相应功能的扩展建议,同时还包括一些个人总结。
[主题词] 道路交通虚拟仿真系统;车辆驾驶仿真;Unity3D

四川大学本科毕业论文 基于 unity3D 的车辆驾驶模拟
2
Vehicle driving simulation based on unity3D
computer science and technology
Student: Adviser:
[Abstract]Road traffic virtual simulation system, which make use of computer’s technique
that instantaneously generated three-dimensional figure, and simulate the situation of the road
traffic can make users have a most closely experience to reality under the fictitious driving situation.
According to Chinese traffic rules of driving, the paper elaborate on design and develop car’s
simulated driving and basic information management of users’ and cars’. Under the basic of road
traffic virtual simulation technique and the industry’s development foreground. To begin with, the
paper put forward the specific design thought about the system through the functional analysis of
requirements and the technique of instantaneously generated three-dimensional figure. Then, the
paper will have a detailed description on the specific implementations of the system’s functions,
and introduce the tools which are used in the process. Furthermore, the next chapter will focus on
the details that how to realize all of those functions, which including the technique of code
implementation, the flow of scene design, the demonstrate of the system’s operation and the test
status of some functions. The last is summarization of system’s design, which covers analysis of the
system’s advantage and disadvantage, and extensional suggestions about relevant functions.
Meanwhile, the author’s summary of the paper.
[Key Words] Virtual simulation system of road traffic; Vehicle driving simulation; Unitiy3D

四川大学本科毕业论文 基于 unity3D 的车辆驾驶模拟
3
目 录
目录
1.项目背景 .....................................................................................................................................1
1.1 道路交通虚拟仿真概述 .................................................................................................1
1.1.1 VR 概述 ................................................................................................................1
1.1.2 VR 在道路交通仿真的应用 ................................................................................1
1.2 市场背景和现状分析 .....................................................................................................1
1.2.1 市场背景 .............................................................................................................1
1.2.2 道路驾驶现状 .....................................................................................................2
1.3 主要研究内容 .................................................................................................................2
1.3.1 模拟车辆驾驶仿真 .............................................................................................2
1.3.2 用户信息和车辆信息管理 .................................................................................3
2.主要开发技术和相应开发工具介绍 .........................................................................................4
2.1 Unity 引擎 ......................................................................................................................4
2.1 Visual Studio ...............................................................................................................4
2.2 Power Designer .............................................................................................................4
2.3 Sub version ...................................................................................................................5
3.系统分析 .....................................................................................................................................6
3.1 术语与缩略语 .................................................................................................................6
3.2 市场和技术可行性分析 .................................................................................................6
3.3 车辆驾驶仿真需求分析 .................................................................................................7
3.3.1 任务概述 .............................................................................................................7
3.3.2 车辆驾驶功能需求 .............................................................................................7
3.4 用户、车辆信息管理需求分析 .....................................................................................8
3.4.1 任务概述 .............................................................................................................8
3.4.2 信息管理功能需求 .............................................................................................8
3.5 系统开发环境 .................................................................................................................9
4.系统详细设计 ...........................................................................................................................10
4.1 综述 ...............................................................................................................................10
4.2 汽车驾驶控制详细设计 ...............................................................................................10
4.2.1 跟踪摄像机 .......................................................................................................10
4.2.2 汽车运行情况观察者——缩略地图 ...............................................................11
4.2.3 汽车驾驶控制及运动效果 ...............................................................................12

四川大学本科毕业论文 基于 unity3D 的车辆驾驶模拟
4
4.2.4 汽车时速、引擎转速显示 ...............................................................................17
4.3 信息管理详细设计 .......................................................................................................17
4.3.1 用户基本信息管理 ...........................................................................................18
4.3.2 车辆选择系统 ...................................................................................................18
4.4.3 车辆信息管理 ...................................................................................................20
4.3.4 系统配置管理 ...................................................................................................20
5.数据库表和配置文件设计 .......................................................................................................21
5.1 信息管理方案概述 .......................................................................................................21
5.2 数据表设计 ...................................................................................................................21
5.2.1 数据库逻辑模型 ...............................................................................................21
5.2.2 数据库表清单 ...................................................................................................22
5.2 系统配置信息设计 .......................................................................................................24
5.2.1 可扩展标记语言和序列化、反序列化 ...........................................................24
5.2.1 配置类设计 .......................................................................................................25
6.项目实施 ...................................................................................................................................27
6.1 SVN 版本控制设置 ........................................................................................................27
6.2 地形搭建和场景规划 ...................................................................................................27
6.3 跟踪摄像机实现 ...........................................................................................................28
6.4 汽车控制功能实现 .......................................................................................................29
6.4.1 重要参数说明 ...................................................................................................29
6.4.2 汽车档位调整实现 ...........................................................................................31
6.4.3 汽车平衡杆实现 ...............................................................................................32
6.4.4 车轮防滑力矩调整 ...........................................................................................32
6.4.5 前照灯实现 .......................................................................................................33
6.5 汽车刹车效果及发动机音效实现 ...............................................................................33
6.5.1 汽车刹车效果 ...................................................................................................33
6.5.2 发动机音效 .......................................................................................................34
6.6 汽车时速表和引擎转速表实现 ...................................................................................34
6.7 信息管理和配置文件管理 ...........................................................................................35
6.7.1 数据表信息管理 ...............................................................................................35
6.7.2 配置文件管理 ...................................................................................................36
7.功能展示和效果测试 ...............................................................................................................37
8.总结 ...........................................................................................................................................46
8.1 系统实现总结 ...............................................................................................................46