o
odin.langpkg.dev
packages / app / Odin-Orbitz

Odin-Orbitz

9093299app

A simple application showcasing drawing circles and text in the Odin language.

MIT · updated 2 years ago

Odin Orbitz

A simple application showcasing drawing circles and text in the Odin language.

Odin Library showcased:

  • Reading a CSV file, with a little bit of error checking
  • Formatting text to add variables to a string
  • Converting a string to a float/int
  • Maths for sin, cos, PI
  • Time for Stopwatch
  • RayLib for displaying everything in 2D

Uses data from NASA and NASA Sun facts.

Keys

  • ESC or Alt+F4 to Quit
  • Mouse wheel to Zoom
  • Mouse right click to move around
  • Space Bar to toggle locking to a planet
  • When locked to a planet 0 to 9 to center on a planet, 0 = Sun, 3 = Earth

Orbitz!

Earth!

Setup and Run

Install Odin: https://odin-lang.org/docs/install/

Add odin.exe to your Path environment variable.

Clone this repo.

Navigate to the root folder of this repo you just cloned.

Run with: odin run .

Bugs

  • The camera doesn't center exactly on the planets. Likely due to floating point precision errors. A float 32 is not precise enough to accurately represent the orbits of the planets.
  • Planets jiggle around when zoomed in, only when locked to Uranus and beyond. Likely due to floating point precision errors.