Over a million developers have joined DZone.

3D Animated Canvas Christmas Tree (Plus: How It Works)

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

In the spirit of the season, how about a clever Canvas Christmas tree? which looks static like this:

but when unleashed on the browser's renderer, rotates beautifully, with shading, in the midst of the falling snow.

Cool enough simply to admire! But apropos of the falling snow and the rotating Christmas tree both, the coder behind the graphic also wrote just about the most helpful 'how I did it' piece you can imagine -- complete with screenshots and diagrams of each stage in the JavaScript, for those of us who can develop web apps but don't easily intuit the language of computer graphics.

The JavaScript comes in at exactly 1024 bytes&characters, too -- the piece won the JS1K Xmas contest last year -- so the code (click on 'view source and description') is a great example of highly condensed programming.

Check out the rotating tree here, and the 'how I did it' here.

And have a great holiday, everyone!!

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}