Docsity

3D Flight Simulator Program - Project IV | CSCI 4967, Study Guides, Projects, Research of Computer Science

Toggle sidebar
bg1
Project 4
CSCI-4967: Three-Dimensional Computer Graphics
Due: Monday, December 6, 2004, 11:59:59pm
1 Overview
In this project, you are to write a 3D flight simulator program for a plane flying over a terrain
environment you create. Your project has two components: generating a realistic looking terrain
and simulating the view from the plane as it moves.
Please see the course web page at www.cs.rpi.edu/˜sakella/graphics/ for project up-
dates and additional information. Also check the course WebCT bulletin board for relevant posts.
2 The Flight Simulator Task
You are to write an OpenGL program to create a simple flight simulator. The displayed scene is
the pilot’s view as the plane moves. Your project consists of the following tasks:
1. Create an environment that includes mountains, water, and man-made structures (for ex-
ample, buildings). The environment is defined over a rectangular region where the XZ
coordinate plane corresponds to sea level height, with the negative Zaxis pointing north
and the positive Xaxis pointing east. You should color and/or texture map objects in the
scene for greater realism. For example, you could have snow capped mountain peaks, plains
with vegetation, or an ocean region. The region of water may be simulated by a blue colored
(or texture mapped) polygon.
2. To create mountainous terrain, use the recursive midpoint subdivision method to generate
fractal terrain over a rectangular region. The color of the terrain should vary with height
to achieve a more natural look (for example, higher elevations of mountains can be colored
white to represent snow). Your midpoint subdivision algorithm should have a parameter
that specifies the maximum height variation, so the height variation decreases with increas-
ing levels of the recursion. You can use the rand() function to generate random numbers.
3. You must also create an adjoining rectangular region of the environment with man-made
structures (for example, a field with a rotating windmill, or a runway, or buildings).
4. Create a simple model of the plane’s cockpit interior, so the displayed scene is the pilot’s
view of the environment from the cockpit.
5. Provide the plane with motion capabilities. The initial position of the plane is specified
by its (x, y, z)world coordinates. Its initial orientation is specified by its (θx, θy, θz)angles.
1
pf3
pf4

Partial preview of the text

Download 3D Flight Simulator Program - Project IV | CSCI 4967 and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

Project 4

CSCI-4967: Three-Dimensional Computer Graphics

Due: Monday, December 6, 2004, 11:59:59pm

1 Overview

In this project, you are to write a 3D flight simulator program for a plane flying over a terrain environment you create. Your project has two components: generating a realistic looking terrain and simulating the view from the plane as it moves. Please see the course web page at www.cs.rpi.edu/˜sakella/graphics/ for project up- dates and additional information. Also check the course WebCT bulletin board for relevant posts.

2 The Flight Simulator Task

You are to write an OpenGL program to create a simple flight simulator. The displayed scene is the pilot’s view as the plane moves. Your project consists of the following tasks:

  1. Create an environment that includes mountains, water, and man-made structures (for ex- ample, buildings). The environment is defined over a rectangular region where the XZ coordinate plane corresponds to sea level height, with the negative Z axis pointing north and the positive X axis pointing east. You should color and/or texture map objects in the scene for greater realism. For example, you could have snow capped mountain peaks, plains with vegetation, or an ocean region. The region of water may be simulated by a blue colored (or texture mapped) polygon.
  2. To create mountainous terrain, use the recursive midpoint subdivision method to generate fractal terrain over a rectangular region. The color of the terrain should vary with height to achieve a more natural look (for example, higher elevations of mountains can be colored white to represent snow). Your midpoint subdivision algorithm should have a parameter that specifies the maximum height variation, so the height variation decreases with increas- ing levels of the recursion. You can use the rand() function to generate random numbers.
  3. You must also create an adjoining rectangular region of the environment with man-made structures (for example, a field with a rotating windmill, or a runway, or buildings).
  4. Create a simple model of the plane’s cockpit interior, so the displayed scene is the pilot’s view of the environment from the cockpit.
  5. Provide the plane with motion capabilities. The initial position of the plane is specified by its (x, y, z) world coordinates. Its initial orientation is specified by its (θx, θy, θz ) angles.

These three angles specify sequential rotations of the plane about the Xw, Yw, and Zw world coordinate axes respectively. There is an orthogonal local coordinate frame attached to the plane such that the Xp axis points to the pilot’s right, the Yp axis points up from the pilot’s seat, and the Zp axis points to the rear of the plane. Then roll corresponds to a rotation about the plane’s Zp axis, yaw corresponds to a rotation about the plane’s Yp axis, and pitch corresponds to a rotation about the plane’s Xp axis. The user should be able to control the position and the orientation of the plane as specified by the keyboard and mouse functions below.

  • f key: The plane speed is set to zero and the plane translates forward (in the direction of the negative Zp axis) by a constant amount ∆f (specified by you).
  • w key: The plane speed is increased by a constant amount ∆v (specified by you) from its current speed.
  • s key: The plane speed is decreased by the constant amount ∆v from its current speed.
  • a/d keys: The plane rotates (rolls) 10 degrees left/right respectively about its Zp axis with each key press.
  • Left/right arrow keys: The nose of the plane rotates (yaws) 10 degrees left/right about its Yp axis with each key press. Additionally, with the left mouse button pressed, a leftward horizontal motion of the mouse should rotate (yaw) the nose of the plane left, and a rightward horizontal motion of the mouse should rotate the nose of the plane right. Use the glutMouseFunc() and glutMotionFunc() functions for this. Scale the mouse motion so that the yaw angle changes by 90 degrees across the width of the screen.
  • Up/down arrow keys: The nose of the plane rotates (pitches) 10 degrees up/down respectively about its Xp axis with each key press. Additionally, with the left mouse button pressed, an upward motion of the mouse should rotate (pitch) the nose of the plane up, and a downward motion of the mouse should rotate the nose of the plane down. Scale the mouse motion so that the pitch angle changes by 90 degrees across the height of the screen.
  • p/P key: Pauses and resumes the motion of the plane, assuming it has a non-zero speed.
  • g/G key: Changes the window to full screen mode by using the glutFullScreen() command, and returns to normal size. The default mode is a normal size window.
  • i key: The plane is returned to its initial configuration. Note that the initial configura- tion of the plane should be above nearby terrain features, and its initial speed should be zero.
  • q key: The program quits.
  1. Use the glutTimerFunc() callback to better specify the motion of your plane when it flies at a specified velocity.
  2. Your README file must describe the complete flight simulator functionality, including plane initial configuration, environment modeling information, and especially any extensions.

instructions on how to compile the code and run it, known bugs or limitations, any extra credit enhancements, and any other relevant information.

Proper submission is entirely your responsibility. Contact the TA if you have any doubts whatsoever about your submission. Do NOT submit your project via email. Be sure to keep copies of your files in a protected directory of your RCS or CS account and do not change them after submitting. After grades are posted, you have exactly one week to resolve all problems. All grades are final two weeks after they are posted. A project that does not follow the submission guidelines will receive a 10 point deduction. If you are unable to submit your project zip file according to the above guidelines, be sure to place it in a protected RCS or CS directory and send email to the TA with the location of the file. Please observe the academic integrity guidelines for the course as described in the course syllabus.