Skip to content

kristoffer-dyrkorn/flightsimulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A flight simulator in your browser

An F-16 flight simulator with realistic graphics, flight dynamics and audio. Runs smoothly at 60 fps on an average laptop.

Try it out! Use arrow keys for control. (See below for more info.)

Screenshot

July 20th 2021: New version!

Highlights:

  • Audio problems are fixed, now using audio worklets.
  • Most prominent tiles are loaded first, reducing apparent loading times.
  • Updated three.js.

April 9th 2021: New version!

A new version has been released. Highlights:

  • Updated satellite photos, taken summer/fall 2019, giving better image quality and more realistic colors.
  • New external cameras: Press space bar to cycle between internal camera (cockpit), external "chase camera" and external "static camera".
  • Geometry and textures have been omtimized. Mesh simplification reduces vertex counts, and compressed texture format reduces upload times and GPU memory.
  • Start coordinates can be given both as UTM 33N and lat/lon values. A starting direction can also be given. See below for examples.
  • Code has been rewritten to use three.js.

Features

  • Realistic visualisation of all of mainland Norway
  • Tiled terrain rendering: The surface is divided into regions that are loaded and unloaded as needed
  • Highly efficient loading of terrain geometry and textures
  • Reasonably accurate flight model of an F-16
  • Internal and external views
  • Synthesized, dynamic engine sound
  • Gamepad support (only tested on an USB gamepad and Chrome)
  • Works on iOS and Android (but no steering implemented so far)

Warning: The code is not beautiful.

Attributions

License

All code and data, except what is mentioned above, is licensed under Creative Commons Attribution-NonCommercial ShareAlike. See https://creativecommons.org/licenses/by-nc-sa/4.0/.

Running

The app can be tried out here.

Startup parameters:

  • Provide starting point coordinates (in UTM 33N or GPS coordinates) using url parameters e and n. Default start point is south of Molde.
  • Altitude (in metres) can be given using the parameter a. Default is 3000 metres.
  • Start direction (compass angle) can be provided by c. Default is 0 degrees, due north.

Example: https://kristoffer-dyrkorn.github.io/flightsimulator/?n=6981000&e=110000&a=1000&c=270

Controls

Use keyboard or gamepad.

Arrow keys control aileron and elevator. z and x: rudder. q and a: throttle. Space cycles camera views. When using the external static camera, move the camera left and right using j and l, and up and down using i and k. Use , and . to move the camera nearer/further away.

Right joystick controls both aileron and elevator. Lower left and right front buttons regulate throttle.

Rendering and keyboard control should work on all modern desktop browsers. Rendering should work on mobile browsers as well, but aircraft control has not yet been implemented.

About

A flight simulator in your browser.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages