I felt like experimenting with sundials in a virtual 3d space. I came across the suncalc library that let me get the sun's azimuth and elevation at a given time. So essentially I already had the time, but I decided to not use that to show the time, but instead get the sun's position from it and use it to set the light's position in threejs and make a sundial.
I took some time to understand how to translate azimuth and elevation angles to x,y and z coordinates. After a little researching, I understood how to determine the unit vectors from these angles.
The only lighting in the scene is one from the sun, so it darkens from approximately around 6pm - 6am.
Link to the sketch
For some reason on deploying the fonts are not loading 😮. Working on fixing it
.
It should ideally look like this.