https://github.com/anvaka/atree
Just a simple Christmas tree, based on reddit story
https://github.com/anvaka/atree
Last synced: about 2 months ago
JSON representation
Just a simple Christmas tree, based on reddit story
- Host: GitHub
- URL: https://github.com/anvaka/atree
- Owner: anvaka
- License: mit
- Created: 2013-12-25T04:14:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-01-03T06:00:01.000Z (6 months ago)
- Last Synced: 2025-04-12T20:43:24.079Z (3 months ago)
- Language: JavaScript
- Homepage: http://anvaka.github.io/atree/
- Size: 39.1 KB
- Stars: 2,482
- Watchers: 51
- Forks: 250
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Christmas Tree
===============I found animated Christmas tree on reddit:

Was curious to make it in js. Current results are here: [Happy new 2025!](https://anvaka.github.io/atree/). Wish you all great successes and joy, doing what you love!
How it's built?
---------------
The tree is built of two spirals. These [11 lines of code](https://github.com/anvaka/atree/blob/2937249242a0204929aca45cdb8b937cfb5af3e5/index.js#L86-L97) render one line on spiral. It includes 3d projection and background shadow. _Almost_ the same as this [wiki image](http://en.wikipedia.org/wiki/File:ComplexSinInATimeAxe.gif):
It's almost perfect now
-----------------------**EDIT:** Thank you reddit. With your help we made it almost perfect. You are awesome!
Huge appreciation goes to [@CensoredUsername](https://github.com/CensoredUsername) who made [significant improvement](http://www.reddit.com/r/programming/comments/1tswai/t_sin_t_christmas_tree/cebhvu9).
[@Yazuak](https://github.com/Yazuak) first gave and implemented [idea](http://www.reddit.com/r/programming/comments/1tswai/t_sin_t_christmas_tree/cebajpt) of how to manage even distribution of points along the curves.
* Vitaliy Kaurov implemented the same tree in Wolfram language... in just [15 lines of code](http://community.wolfram.com/groups/-/m/t/175891).
* [David Librera](https://github.com/davidlibrera) rewrote this in CoffeeScript. Checkout [his repository](https://github.com/davidlibrera/atree/tree/master/js/coffee) for nice OO design.
* Chris Warren-Smith [wrote it in SmallBASIC](https://gist.github.com/chrisws/3cf97b7b7f1c2d6f9741464a2dfb3c3b)
* Mike Mallin made it [available in C](https://github.com/mremallin/christmas_tree) using SDL2 and OpenGL 3.2
* SFML port by [@deniskropp](https://github.com/deniskropp) is available here: https://github.com/deniskropp/christmas_treeSo, what's left? Just small changes which could make this tree perfect:
* Shadows are not accurate
* I think code is more complex than it should be (subjectively).# Happy Holidays!
# license
MIT