🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #403

Flight simulator control

#403
From: Richard Barry Ling
Date: Tue, 04 Aug 1992 03:18
33 lines
2231 bytes
Yo all.

  I'm trying to program a flight simulator using a language with a 3D
graphics capability.  This package allows me to model an object, then rotate
it around the axes, position it, move it forward a certain distance etc, but
I'm having serious trouble working out how to translate the controls for the
aircraft into angles around the X, Y and Z axes.  I need to convert relative
changes in the pitch, yaw and roll of the plane into absolute angles. In
short, my trigonometry sucks.

  The problem: I have to give the 3D package 3 numbers - the angle to rotate
about the X axis (horizontally across the screen), the Y axis (vertically
across the screen), and the Z-axis (perpendicular to the screen). The
computer rotates the plane about X, Y and Z in that order, and displays the
result.  Imagine viewing the plane from behind: If I pitch the nose up
(rotate about X axis) then roll the plane thru 180 degrees (rotate about Z)
the nose ends up pointing downwards, which is not very desirable.  Or if I
roll 45 degrees (Z axis), then pitch (X-axis), the Y-axis angle has to
change as well.

  I imagine there must be some nice mathematical formulas out there to
handle these rotations.  I have lost sleep, sanity, and large amounts of my
hair over this problem.  Any and all help appreciated.

*******************************> NOTICE! <**********************************
 PLEASE REPLY VIA E-MAIL, since our newsfeed is currently 2 weeks behind...
****************************************************************************

--------------------- Richard.  u9147603@cs.uow.edu.au ---------------------
"The rooster stared back at me, his power and confidence almost overwhelming.
Down below, a female paused warily at the coop's entrance. I kept the camera
running. They were beautiful, these 'Chickens in the mist'."  -  Gary Larson
Technical Details
Message-ID: <1992Aug4.031856.9365@cs.uow.edu.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!cs.uow.edu.au!u9147063

Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!cs.uow.edu.au!u9147063
From: u9147063@cs.uow.edu.au (Richard Barry Ling)
Subject: Flight simulator control
Message-ID: <1992Aug4.031856.9365@cs.uow.edu.au>
Organization: Dept of Computer Science, Wollongong University, Australia
Date: Tue, 4 Aug 1992 03:18:56 GMT
Lines: 33