Building a Flight Simulator with Javascript and THREE.js

Restarting my old C++ Project in Javascript with THREE.js

A picture of the author, Jakob Maier
Jakob Maier
Mar 4, 2021

Update: I have been working on a significantly improved simulator, you can find the article here.

When I was working on my F-16 flightsim project back in the first lockdown I used raw OpenGL and C++ to build the game. After working on it for some time I realized that I was in a bit over my head. I was spending a lot of time just debugging OpenGL and fixing weird bugs in my arguably really bad C++ code. Never having worked with C++ before I was just figuring it out as I went along. The flight model was another thing, the physics and the flight control system proved to be orders of magnitude more complicated than I had imagined. At first I focused on building a sim for the MQ-9 Reaper combat drone, but I am now again working on the F-16 Viper, which is just a much more interesting aircraft in my opinion. The goal is to have a player controlled Viper and some type of opponent aircraft controlled by AI as well as some Surface-to-Air Missiles that can threaten the player. You can play a preliminary build here, without installing anything, in your web browser. The repository can be found on github.

Three.js proved to be absolutly perfect for my use case. It made everything so much easier and even came with a few special effects that make everything look much more beautiful in my opinion.

You can control the aircraft with WASD, use numbers 1 - 5 to switch between views.

F-16 F-16

↑ back to top

© 2023 Jakob Maier
kontakt & impressum