Computer Graphics – Project Report: vlAsh
Table of contents
Part 1: Introduction
vlAsh is an OpenGL helicopter simulation written in C++ using the GLUT toolkit and running under Linux and Windows. The helicopter is entirely modelled in 3ds max and consists of only a few separate elements. The main body is based on a cuboid which was then modified using mesh modifications in 3ds. The landscape has its basis on a heightmap on which a texture was applied. The heightmap and texture were generated under Linux using Terraform. To give the impression of open space, a skybox has been added around the scene. The elements of this box were rendered under Windows using Terragen.
A sophisticated concept and implementation are used to make the code as versatile as possible. The use of this code for other simulations should not present any major problems since the class model is highly adaptive. The 3D model is read into the program and then saved in internal data structures. All transformations are calculated matrix operations.
In order to speed up the rendering process, display lists are used to cache the data to be sent to the graphics card. Helicopter movements are independent of the number of rendered frames per second. The built-in fps counter is used to equalize every move performed by the helicopter to give the impression of equal speed under every circumstance. To turn the helicopter more realistic, ambient lighting is used to intensify the looks of the shape.
Navigating the helicopter is done using the arrow keys for pitch and roll movement. The rotor throttle and tail jet are controlled using the 'w', 's' and 'a', 'd' keys resp. for up and down movement and left and right turns, resp. The cameras on the other hand can be switched using the number keys '1' to '3'. Camera control is exercised using the following keys:
- 1: Stalker cam (constantly follows the helicopter in its back)
- 2: World cam (motion along circles of latitude and longitude, i.e. spherical coordinates)
- 3: Fix cam (fixed direction camera)
- j, l: lateral movement
- i, k: azimuthal movement
- u, m: zoom
- f: toggle object following (only for world cam)
- Space: reset camera
In order to switch between different display modes the F-keys can be used:
- F1: Toggle wireframe mode
- F2: Toggle smooth/flat shading
- F3: Toggle drawing of normals ("porcupine mode")
- F5: Toggle heightmap
- F6: Toggle terrain texturizing
- F7: Toggle skybox
- F10: Toggle gravity
The escape key is used to terminate the program.
Part 2: Screenshots
This section provides a few screenshots taken of our helicopter running under Linux.
Shading modes
Flat shading
Smooth shading
Part 3: License
The vlAsh source code is published under the GPL v2 license as follows:
Copyright (C) 2004-2005
Martin Rubli
Patrik Bless
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Part 4: Download
Version 1.0 source code, artwork, and binaries (Linux and Windows):
- vlAsh-1.0.tar.bz2 [728 kB]
- vlAsh-1.0.rar [770 kB]