September 29, 2025

Tiny Code Christmas - Day 11

Link to the eleventh day

On day 11, we created a 3d effect.

We create a 3d cube full of spheres and rotates them around all 3 axes simultaneously.

The spheres are created one by one and rotated around the middle of the screen.
Afterwards they are added to a table.
Before drawing, we need to sort the spheres by their z-coordinate. 
The spheres further in the background are drawn first and possibly overwritten by nearer spheres.
For each sphere, we draw 3 circles to imitate a reflection point, while setting the color according the z-coordinate.

Packing reduced the size from 1.205 to 255 bytes.

Link to my solutions

Here is the resulting image: 


 

No comments:

Post a Comment