jsRC - Developing an In-Browser Flight Simulator

Over holiday break I spent a lot of time "vibe coding" an RC flight simulator that runs in the browser, built on JavaScript and Three.js.

You can check out the demo here:

https://markbaldridge.com/jsrc/

https://github.com/marktbaldridge/jsrc

This is a WORK IN PROGRESS. I wouldn't even call it a v0.1 yet. You might quickly recognize the model and graphics. I intend to produce my own model and scenery. However, I do intend to keep compatibility with ClearView into the future.

Current Features:
  • Loads a ClearView model and landscape.
  • Gets control input from USB game controller or keyboard.
  • Implements two distinct physics reference frames, "World" and "Body", and translates motion and physics between them.
  • Code uses all real-world metric units
  • Fixed-timestep simulation that is interpolated to graphics framerate
  • Double-integration from acceleration vectors to velocity vectors to location vectors.
  • Right now, the model just behaves mostly like a rocket with a maximum speed in a gravity-free, air-free environment. Again, work-in-progress. :)
Missing Features:
  • Collision detection
  • Gravity
  • "Real" Aerodynamics
  • "Real" ground-handling physics (like sprung articulating landing gear)
  • Sound effects
  • Model/Scenery Selection
  • There are some bugs "finding" the game controller for the first time.
  • Light/Shadows
  • Camera Zoom
  • Model Reset

Goals:
  • Be a viable way to learn basics of RC flying.
  • Realistic enough physics to translate to real-world flying of models.
  • Mostly focusing on airplanes right now.
  • Cross-platform
  • Free & Open Source

I am just one guy working in "project management" mode, getting various LLMs (AI) to do the "heavy lifting" of coding.

What do you all think? Do you want me to keep working on this project?
 
Last edited:

clolsonus

Well-known member
It's pretty neat that you can do so much with vibe coding and have it run in the browser. I know AI + coding is a rapidly evolving technology, so I'd be interested in how hard or how much effort it will be to go from the thing the AI system spits out just from your prompts to adding in missing features, or fixing things the AI doesn't know how to do.
If you want to explore "real" physics and gravity and ground handling, JSBSim is one pretty cool option. It is C++ but has python wrappers. It might not help you with a javascript app ... but all the hard math is done, you just setup the aero parameters and mass and geometry and prop and power for the aircraft you want. This is nasa/pro/research/edu level code, so it is super legit and has been used widely going back 20+ years. (And I know the original author, so I guess I'm a little biased.) :)
I love your goals, so independent of what language you choose and path to get there, I think you are right on the mark. I can't say if a lot of people would be interested in something like this, but you will learn a /massive ton/ of cool things if you push forward.
Going way back to late 1996 I was part of the group that launched the FlightGear open-source flight simulator and I carried that on my shoulders for many years until it got enough momentum on it's own. There may be a lot in the FlightGear project that would be helpful to you, but there are many things I'd do much differently if we were starting that today. And I am certain there are many things you will want to do different yourself for all good reasons.
I love the idea of a javascript sim and anyone being able to easily run the sim in their browser. I am a lifelong open-source fanatic. But personally I like to do as much of my development in python as possible because I like the language and the ecosystem ... so that's where I've put my eggs the past 10-15 years.