My task is to write a mini-flight simulator, one that has a fixed point of view from the cockpit of any plane, without even seeing the cockpit or any other part of the plane.
The terrain above which the aircraft will fly should be taken from an existing GIS repository, for example Goggle Earth or another source if any. The flight area can be a of limited area, for example several hundred square kilometers of desert with roads and streams, so there is no need to connect to an infinite real database, or in other words, the map can be static.
It is desirable that the 3D terrain be as realistic as possible but there is no need for a very high level of details. The flight above the surface will usually be at an altitude of about 1,000-2,000 meters and not lower than a few hundred meters, so that there will never be a touch down or landing.
I suffer from inexperience in graphics programming except for basic things but by no means in 3D, so my questions are basic and they are all around the question of where to start.
I would appreciate any tip and would love to expand where it is not clear what I meant.
This sounds like a really cool project and a nice scope for learning without getting overwhelmed. Keeping the view fixed from the cockpit and the map static makes a lot of sense.
You might enjoy this video as a bit of inspiration, it shows a simple flight simulator idea that feels close to what you’re describing:
I’m also planning to build a flight simulator in the future myself, using cannon.js to control the aircraft and experiment with more realistic air behavior like drag and friction, so I’m following this kind of work with interest. It feels like a good way to grow into 3D without trying to do everything at once.
Looking forward to seeing how your project develops.
You can take a look at my flight demonstrations to see what kinds of things you can do with three.js. Over the years, I have created several open source modules to help programmers create their own flight simulation.
MORE
You will notice that I have not implemented a full 3D terrain. Instead, I am adding 3D models of islands and mountains on top of the water or terrain. The flat ground texture I am using has a resolution of 1/2 foot per pixel, which is very high and helps with estimating your height above the ground (along with the shadow).
There are many good examples of full 3D terrain, including an official three.js example and many examples on this forum and on YouTube. One YouTube example used a nicely detailed terrain (of limited size) created entirely in Blender. So you will have many options to choose from.
It has some relatively sophisticated terrain and an ammo.js wasm integration for physics and various tricks. It’s been a while since I looked at the code myself but I think the foundation of the terrain is a potential solution for also rendering streaming terrain data of an arbitrary size.
The physical terrain in this uses a 2048x2048 heightmap to make a 20*20km static world.