Inspiration

After doing several HTML and Python projects

  • Still wanting to do a computer science project but with objects, not just outputs on consoles.
  • Already did a very basic tutorial in Unity and found it interesting, wanted to keep building off it.
  • Interest in astronomy, wanting to create comparisons to better understand the vastness of space. ## What it does Helps visualize the speed of light and its speed relative to massive objects
  • Speed - Adjustable speed of camera.
  • Free Movement - Camera can move in all axes and rotate.
  • Size - Two adjustable planets with radius inputs.
  • Orbits - Circular orbit around each planet, uses speed as input. ## How we built it ###Planning and General Setup
  • Going for a space theme with planets.
  • Thinking about equations for circular orbit.
  • Finding space-related assets to download and import for the sky and planets (asteroids came later). ###Unity ####Unity Setup
  • Important space-related assets, making the skybox.
  • Creating 3D Game Objects: Creating two spheres to serve as planets, asteroids, and a line to keep track of the two planets.
  • Creating UI: Adding a pair of orbit buttons and radius text boxes, as well as one distance and one speed text box. ####Coding
  • Scripts (Part 1): Initializing individual scripts for the camera, planets, and asteroids.
  • Event Triggers/Input: Creating event triggers for the orbit buttons and InputFields for the radius, speed, and distance text boxes, which are connected to the planet and camera scripts.
  • Scripts (Part 2): Incorporating camera movement, speed, and radius to create orbits. A script for one planet contained the distance information and radius, and the initial planet used radius to change the size and gap between the planets.
  • Testing and Cleaning: Tested the inputs on the first planet, then applied them to the other. Abstracting the code: using more variables and making sure inputs make sense.
  • Finalizing + Extra Touches: Creating additional scripts for the asteroids to rotate, making adjustments to equations, and adding instructions + key. ## Challenges we ran into ### Unity Itself
  • Crashed Twice and resultantly lost progress.
  • Heavy battery consumption, limited my workspaces to areas near outlets.
  • Errors clogged the console, sometimes annoying to get useful information. ### Coding
  • Finding the right equations for the circular orbit. I accidentally used derivates of the orbit instead of basic trigonometry and lost a lot of time because of my mistake.
  • Code took longer than expected due to the number of connections between UI and GameObjects. ## Accomplishments that we're proud of ### Ascetics
  • Nice assets, asteroids added an extra appeal. ### Organization
  • Although the buttons are not very abstract, they are organized in a logical way and all work as expected. The controls are cohesive as well. There are no detrimental glitches found so far. ## What we learned ### Inspector in Unity
  • Better understanding of event triggers.
  • Knowing better how to connect something to code.
  • Using the inspector to better monitor positioning. ### C#
  • How to add inputs directly from scripts.
  • Transform: learning how to rotate, change size, and change the position of an object.
  • Syntax: learning the types of variables and functions, math, and concatenation. ### Ascetics
  • Using skyboxes ### Dedication
  • Working on a single project for many hours this weekend helped improve my mental and physical endurance. ## What's next for Basic Space-Themed Visualization
  • Built-in Stopwatch: A stopwatch that measures time elapsed between distances covered.
  • Better Buttons/UI: Buttons that end the function when clicked again and that don't overlap. Condensing and simplifying the interface, as well as improving its overall style.
  • Option to add any number of planets.
  • Elliptical instead of circular orbits.
  • Fitting project to any screen.

Built With

Share this project:

Updates