4 ms·
T * sin (t) ≈ Christmas tree
- pcharles 13y agocool
- popotamonga 13y agoSame formula on Quake's Railgun
- icefox 13y agoGot a link? Google found this Quake2 railgun, but it doesn't look to be the same on first glance https://github.com/id-Software/Quake-2/blob/master/ctf/g_weapon.c#L653 https://github.com/id-Software/Quake-2/blob/master/ctf/g_wea...
- angersock 13y agoThat's the game attack logic, not the rendering logic. You want this instead: https://github.com/id-Software/Quake-2/blob/master/client/cl_fx.c#L1613 https://github.com/id-Software/Quake-2/blob/master/client/cl...
- coherentpony 13y agoYeah it's a helix.
- swamp40 13y agoI really like the simplicity. Can you reverse the direction of one of the spirals? Or maybe slow down one to half-speed? (Maybe it would look better, maybe not.)
- thejacenxpress 13y agoNice job
- marcosscriven 13y agoReally like that - beautiful and elegant.
- adamnemecek 13y agoSomeone also reimplemented it in Mathematica http://community.wolfram.com/groups/-/m/t/175891 http://community.wolfram.com/groups/-/m/t/175891
- chippy 13y agoVery merry cleverness
- sheetjs 13y agoOriginal reddit post: http://www.reddit.com/r/programming/comments/1tswai/t_sin_t_christmas_tree/ http://www.reddit.com/r/programming/comments/1tswai/t_sin_t_...
- kevining 13y agoLink to github.io page for the lazy: http://anvaka.github.io/atree/ http://anvaka.github.io/atree/
- zafka 13y agoThis reminds me of when I first started programming in Turbo Pascal. I made a Christmas tree using graphic mode and trig functions. I also only used if-then statements so i ended up with about a thousand lines :) Looking at this more elegant tree reminds me of why I went into this career.
- CodeWithCoffee 13y agoIt seems awfully appropriate 'starring' this repository.
- jwmerrill 13y agoQuick reimplementation in the desmos graphing calculator: https://www.desmos.com/calculator/brjshfkaof https://www.desmos.com/calculator/brjshfkaof Press play next to t_0 to animate.
- elwell 13y agowith dynamic alpha, and mouse orient around x-axis: http://jsfiddle.net/rYa5d/1/ http://jsfiddle.net/rYa5d/1/
- elwell 13y agoActually it's a little better when more spaced out: http://jsfiddle.net/rYa5d/8/ http://jsfiddle.net/rYa5d/8/
- coverband 13y agoVery nice and not complicated at all -- good work!
- mamadou 13y agoThanks for sharing!
- callmevlad 13y agoExtra credit to anyone who can implement this in HTML/CSS without using the canvas element. Since CSS transformations are hardware accelerated, I bet it can be made to look as smooth as the reference GIF.
- elwell 13y agoStill canvas, but is that any smoother?: http://jsfiddle.net/rYa5d/8/ http://jsfiddle.net/rYa5d/8/
- karanbhangui 13y agoNice touch with the subtle parallax!
- britta 13y agoSeveral years ago I made a very silly simple Christmas tree in HTML/CSS, with <blink>ing lights and Unicode ornaments, and my friend made a way to place your own choice of "ornaments": http://unicodexmas.com/ http://unicodexmas.com/ Not as stylish, but in the spirit!
- prafulrana 13y agohttp://runnable.com/Ur4mzpVUigJbAALD/christmas-tree-%5Bt-*-sin-t-%E2%89%88-christmas-tree%5D-for-javascript-and-animation http://runnable.com/Ur4mzpVUigJbAALD/christmas-tree-%5Bt-*-s...
- GeorgeKangas 13y agoMay I suggest t * sin( k * ln(t) ), for some constant k? That makes the path self similar about the (0, 0) point. Maybe you'd like that.
- gky2 13y agoOh god staring at this just motivates me to work. Thanks a lot for sharing, as well as all the commenters showing the different implementations of it.
- c3d 13y agoYet another entry. The Christmas tree in Tao Presentations is less than 30 lines of code, with a star at the top and blinking lights. Code here: http://www.taodyne.com/shop/dev/en/blog/275-a-christmas-tree-is-x-sin-x http://www.taodyne.com/shop/dev/en/blog/275-a-christmas-tree....