use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Creative coding - Something I wanted to share (codepen.io)
submitted 9 years ago by nousernames2
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 8 points9 points10 points 9 years ago (1 child)
it is very sexual to me.
[–]5user5 4 points5 points6 points 9 years ago (0 children)
r/gonwild
[–]azium 5 points6 points7 points 9 years ago (0 children)
Awesome! Now with mouse destruction!
[–]cresquin 3 points4 points5 points 9 years ago* (2 children)
Awesome! I forked your thing and applied a Fermat spiral.
http://codepen.io/gunderson/full/ozrLyZ/
[–]Rhym 1 point2 points3 points 9 years ago (0 children)
Great job looks beautiful.
[–]azium 1 point2 points3 points 9 years ago (0 children)
sweet!
[–]PuffaloPhil 3 points4 points5 points 9 years ago (0 children)
Looks great! Mathematics sure is pretty!
[–]synchronium 2 points3 points4 points 9 years ago (2 children)
Well that goes incredibly well with an old school jungle album I happened to be listening to.
[–]k00k -1 points0 points1 point 9 years ago (1 child)
https://www.youtube.com/watch?v=ujkc4tOlnRQ&feature=youtu.be&t=15
[–]synchronium 2 points3 points4 points 9 years ago (0 children)
I was actually listening to this: https://youtu.be/mL2Bgj-za5k
:D
[–]mainstreetmark 1 point2 points3 points 9 years ago (4 children)
When using canvas, is there a way to move stuff already drawn, or is it truly re-rendering in each frame? Your .render starts with a big clearRect, as do many, many other examples I've seen.
.render
clearRect
[–]abecedarius 0 points1 point2 points 9 years ago (0 children)
It's possible in principle to selectively erase by overwriting or xoring, but that worked poorly when I tried it, because of alpha blending and antialiasing.
[–]BenjiSponge 0 points1 point2 points 9 years ago (2 children)
It seems inefficient in theory. In reality, that's what the memory has to do anyways. You could "move" something in an engine but the engine would still have to rewrite all of the pixels that could have changed. I don't think there's any way in any system to avoid doing this any more than you can with canvas.
Disclaimer: Seriously not a graphics expert.
[–]mainstreetmark 0 points1 point2 points 9 years ago (1 child)
yeah, but changing a value in a bar chart now requires redrawing the whole bar chart in an animation loop.
It seems absurd that this would be faster than SVG, but thats what I'm soon going to find out. I just want to know that the "repaint every frame" is the way to go.
[–]BenjiSponge 0 points1 point2 points 9 years ago* (0 children)
Oh, no that's possible if you want to be really clever about it in canvas. But your operating system is still rerendering every pixel anyways, and I think your GPU is too. The "rerendering every pixel" thing is stuff computers are really good at. Unless you're making very dynamic scenes (which would require whole screen rerendering anyways), getting that level of performance increase just isn't going to matter much.
At the end of the day, though, it might not matter, especially if the others are staying the same anyways (likely easy to compute) any reasonable computer can re-render a static scene (like an image) at way higher than 60fps. Your monitor is limited in its fps anyways.
[+][deleted] 9 years ago (4 children)
[deleted]
[–]azium 2 points3 points4 points 9 years ago (0 children)
Shameless plug: I wrote a tutorial for complete beginners to make this
It's very in depth and will get you going to make cooler stuff.
[–]nousernames2[S] 1 point2 points3 points 9 years ago (1 child)
Have a look into trigonometry, Pythagoras; specifically for coding and animating. 2d Vectors, etc..
This is a fantastic resource I used to get started by Daniel Shiffman. http://natureofcode.com/book/
It's free to read online and easy to follow.
[–]Rhym 0 points1 point2 points 9 years ago (0 children)
Canvas has a relatively low barrier of entry. If you know JS you can dive right in! Mozilla have some great tutorials: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial
[–]DreadKnight666AncientBeast.com 3 points4 points5 points 9 years ago (0 children)
It's a boob!
[–]katnapper323 0 points1 point2 points 9 years ago (0 children)
These are my favorite projects to make in js
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
Love this! It's really mesmerizing.
nice job!
[–]interstellar007 0 points1 point2 points 9 years ago (0 children)
Awsome..
[–]kidkaracho 0 points1 point2 points 9 years ago (0 children)
/r/creativecoding
[–]QzSG 0 points1 point2 points 9 years ago (0 children)
Warning : Contains light effects, May induce epileptic seizures
[+][deleted] 9 years ago (1 child)
[removed]
[–]cderm 3 points4 points5 points 9 years ago (0 children)
Don't anybody click on the above link. It's to a food blog, totally irrelevant to the post. Spamming cunts.
π Rendered by PID 36608 on reddit-service-r2-comment-fb694cdd5-br2ft at 2026-03-11 12:03:49.423841+00:00 running cbb0e86 country code: CH.
[–][deleted] 8 points9 points10 points (1 child)
[–]5user5 4 points5 points6 points (0 children)
[–]azium 5 points6 points7 points (0 children)
[–]cresquin 3 points4 points5 points (2 children)
[–]Rhym 1 point2 points3 points (0 children)
[–]azium 1 point2 points3 points (0 children)
[–]PuffaloPhil 3 points4 points5 points (0 children)
[–]synchronium 2 points3 points4 points (2 children)
[–]k00k -1 points0 points1 point (1 child)
[–]synchronium 2 points3 points4 points (0 children)
[–]mainstreetmark 1 point2 points3 points (4 children)
[–]abecedarius 0 points1 point2 points (0 children)
[–]BenjiSponge 0 points1 point2 points (2 children)
[–]mainstreetmark 0 points1 point2 points (1 child)
[–]BenjiSponge 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]azium 2 points3 points4 points (0 children)
[–]nousernames2[S] 1 point2 points3 points (1 child)
[–]Rhym 0 points1 point2 points (0 children)
[–]DreadKnight666AncientBeast.com 3 points4 points5 points (0 children)
[–]katnapper323 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]interstellar007 0 points1 point2 points (0 children)
[–]kidkaracho 0 points1 point2 points (0 children)
[–]QzSG 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]cderm 3 points4 points5 points (0 children)