Taking inspiration from Andy Sloane and his famous donut, I wanted to see if I could create a shape in ASCII art rotating around in the terminal.
What this has lead to is creating a shape class that can be inherited from to get the display to the terminal. All an inheriting shape has to do it setup the 3d space full of points and the Shape parent should do the rest.
Currently not finished but that's the goal...
- Cube object creates the 3D space using Coords.
- We calculate the normal of the surface and use this to find the angle against the light, the more aligned, the more
- We create a projection of the 3D space into 2D.
- Normals are not calculated correctly, or if they are the wrong one is being chosen. Could be due to a number of things:
- Incorrect order during cross product. Might need to make sure we aren't getting the normal pointing inside the shape.
- get_nearby() could be choosing wrong points to create cross prod with, should vefiry that the points are correct.
- Need to figure out why its slowly zooming away, this should not be happening. Maybe its a problem with floating point numbers? Maybe we're rounding somewhere, not sure.
- Use GPU calculations for vector calculations (will need to then limit frame rate).
- Create vector class so that we know when dealing with vectors or points (coords). Not neccesary but could be helpful.