Coding Challenge
Вставка
- Опубліковано 31 тра 2024
- In this holiday coding challenge, I create a "Brownian Tree Snowflake" in Processing (Java). This video was recorded as part of a fundraiser for the Processing Foundation. Code: thecodingtrain.com/challenges...
🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/s...
🎥 Previous video: • Coding Challenge #126:...
🎥 Next video: • Coding Challenge #128:...
🎥 All videos: • Coding Challenges
References:
💰 Support the Processing Foundation: processingfoundation.org/supp...
💾 Code Golf - Draw a Snowflake: codegolf.stackexchange.com/qu...
❄️ Snowflake: www.flickr.com/photos/golanle...
Live Stream Archive:
🔴 Coding Train Live Holiday Telethon 2018: • Coding Train Live: Pr...
Related Coding Challenges:
🚂 #34 Diffusion-Limited Aggregation: • Coding Challenge #34: ...
🚂 #52 Random Walker: • Random Walker in p5.js...
🚂 #128 SketchRNN Snowflakes with ml5.js: • Coding Challenge #128:...
🚂 #129 Koch Fractal Snowflake: • Coding Challenge #129:...
🚂 #155 Kaleidoscope Snowflake #SupportP5: • Coding Challenge #155:...
Timestamps:
0:00 Introduction
0:51 Brownian tree
1:46 Diffusion Limited Aggregation
2:18 Snowflakes have a hexagonal pattern
3:52 Create a Particle class
4:52 Add a random walk to the particle
6:19 Translate to the center
7:02 Make an array of snowflakes
8:00 Write a finished function
9:05 Write an intersects function
11:04 Add kaleidoscope
13:18 Edit code to add a vector
14:00 Constrain particle to a slice of the hexagon
15:52 Speed up the animation
16:43 Improve branching
17:33 Randomize the starting position
18:10 Conclusion and creative possibilities
19:05 Please consider supporting the Processing Foundation!
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/pas...
🚩 Suggest Topics: github.com/CodingTrain/Sugges...
💡 GitHub: github.com/CodingTrain
💬 Discord: thecodingtrain.com/discord
💖 Membership: ua-cam.com/users/thecodingtrainjoin
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: / thecodingtrain
📸 Instagram: / the.coding.train
🎥 Coding Challenges: • Coding Challenges
🎥 Intro to Programming: • Start learning here!
🔗 p5.js: p5js.org
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org
📄 Code of Conduct: github.com/CodingTrain/Code-o...
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecod...
#browniantreesnowflake #snowflakegenerator #diffusionlimitedaggregation #processing
I’ve been watching your videos for a few months now and learn something new in each one. Just wanted to say thanks for putting this resource out there and making it as accessible as it is. Season’s greetings! Thank you! (EDIT: space-filling curves could be a fun video ;) )
I'm digging that coding trail sweater, haha. I always love these coding challenges; thanks again for all your hard work.
You really do good job 💪 I understand more than from tutorials, courses etc. After that I'm trying write my own code. There is just a practice ! You explain everything and that's help me a lot ❤️ Merry Christmas from Poland 🎅
Merry Xmas! You made all of this look so simple ...every time I watch your video I learn something new! Thank you Dan!
Merry Christmas from Germany! Thank you for your tutorials and keep going!
That last one looked so awesome!!!! 🤩
it looks so good !! Good job
As always, Wonderfull! I worked with DLA (for scientific research) when I was an undergrad student. Never thought it would be so much fun!!! Thank you!
I just saw your channel.. You are awesome. So much of things to learn.
Wow, can't skip these videos once started watching. Thank you so much for teaching us.❤
Thanks for the work you are putting into your channel, it is really great :)
Merry christmas from Germany :)
This is so over my head it’s unbelievable
Dan, whoever made you that sweater is great :D
"never forget the this dot"
Thank you again for this interesting video and Merry Christmas from Toronto.
Render them to their own image buffers and use each one as a particle in a gravity + Brownian motion simulation. Result = realistic snowfall. Or if left as just arrays of particles, allowed them to have a speed, and made them able to break if going to fast when they hit the ground. Then let them pile up on the ground.
Great idea! I hope someone does this 😀
Awesome! It’s really cool. 😄
I love your Videos!😱😱,
thanks to you I started my channel because you inspired me!
Congrats!
Feliz Navidad desde Colombia 😊
Awesome video!
Thanks for these awesome challenges, its kind of inspiring and fun by the way you do them. Have a nice Holidays and you should make a working Rubiks Cube for another video
SO COOL!
anything u can coding, u sick dude
Really love your videos! A few others suggested physics; what about slingshots/catapult simulation?
u are legend man ...wish i can code like u...keep it up........
This is the coolest thing I've seen all week (yes, I know this video is 2+ months old)
Amazing
How do you make the font bigger in processing?
Merry christmas (eve), Dan :>
How about ripple animation with motion detection? Tap anywhere and a ripple motion is there BUT it can collide with an existing ripple too. Seems fun, not sure how much of it is possible though. :)
It is possible. I'll give it a try after my exms get over.
Add it as an issue to the rainbow topics github.
Thanks!
Damn.. so cool
why are you using x_ and y_ in the constructor? does processing not support using this. to disambiguate?
To kill boredom
I do programing
I love to create things
Merry Christmas
Do a slingshot simulation!
This is fascination
I want that Christmas sweater!
Made by twitter.com/kosamari !
tks
I'm trying to turn this into an array of points and then I'm trying to connect those points by using vertexes but I'm not able to retrieve the centers of the ellipses. I'm kinda lost here.
Dope
Idea for challenge: elastic collision of two objects: both one moving and one stationary , and both moving
Good outfit
is there a way to automatically export the generated image as a PNG with the same resolution as the canvas?
Take a look at save() and saveFrame() in Processing.
10:00 when this dot works too well
Where do i get this sweater?
Tnx u sir it's awesome
4:07 The "var_" naming kills me inside
How would l make this code work in eclipse java?
16:08 This is incredible
Where is he making these programs, I use intellij and it would take me days to do these programs
You are such a great programmer! Please attempt to make a rubik’s cube
A random walk is actually meant to be a random process with independent increments. It is dy that should be Gaussian distributed not y itself.
I think you should make a long B roll video of all the graphics you have made with nice music as something to chill and watch. Please?
Yeyy
Go particle go, go particle go, go particle go, STOP!!
hi, cool ,,,But I dont really understand why the count++ will be return 0??? Could you pls show me the right way? many thanks!!!!:)
Which software you are used?
This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org and also this video might help ua-cam.com/video/AmlAiKsiy0o/v-deo.html.
you really always should use "this.", thats good coding practice and prevents ugly hacks like your float x_ thing.
Good point!
Any Python user here? How do you translate, scaling and rotate coordinate in Tkinter?
I don't know whether tkinter has any of those functions but i get around those by making my own functions. I did complete many of his challenges in python.
It isn't recommended but I'm doing that so that i need to code everything that happens on the screen with the least possible use of library functions. I expect to make my base in programming stronger by doing this.
I feel like it’d be more snowflakey if you didn’t constrain the angle/particle destination to the one sector
Wow, you've never heard of code golf before
Woah I'm way earlier than normal. Only 1 hour ago?
I like you man. You’re intelligent guy. I wish I can be like you are. But I’m not , i am so disappointed my self! Right now I am started learning programming languages JavaScript & c++ they’re so complex too.
A tip would be to learn just one language first, but properly and thoroughly.
I would recommend C++ over other languages if you ask me.
and get a high school level book that contains programming. That way you wont get overwhelmed by the code that is found in any "Introduction to programming" and still be able to build your base.
Another tip: Don't get overconfident about solving a problem. Some things feel really easy and simple at first but when you attempt them then you get to know.
Just be thorough with that book and see the results.
Once you've build your base then you can come over to youtube and see videos like these to understand the various problems that are encountered and what approach do programmers take to takle such issues.
And don't expect to learn programming in a month or even 2 to 3 months. It will take time, a long of time even if you are diligent.
Thank you for your advice man. And I like to ask you one more question, what’s the programming languages should I take first, JavaScript, or c++, the both of them which ones is better to compare? Right now I’m just take self learning on this courses , it’s hard to understand without a constructor’s explains .thank you.
@@liukang81 I would recommend C++.
There's a reason I asked you to start learning from high school books. They are simple. These books assume that the guy knows nothing about programming and that's why they are absolutely the best books to start learning.
jij ben nederlands or aren't you?
where can i learn processing online?
This channel. He has a playlist called
"Learning Processing: A Beginner's Guide to Programming Images, Animation, and Interaction"
After you finish that, he has a playlist (or alternatively or along-side it, his book) called
"The Nature of Code: Simulating Natural Systems with Processing"
Indeed, here are two playlists to start from the beginning! There are also many other books and resources at processing.org and p5js.org.
ua-cam.com/users/shiffmanplaylists?view=50&shelf_id=14&sort=dd
ua-cam.com/users/shiffmanplaylists?view=50&shelf_id=2&sort=dd
I have an idea for another merch item:
Roses are red
Violets are blue
Expected { or ;
At line 32
can u please code "THE LIBRARY OF BABLE"????????????? PLSSSS!!
Dan, please go to Codewars and solve difficult Katas
which language are u using?
Bibash Katel He using Processing of Java
Indeed! This video uses Processing (which is built on top of the Java programming language). For more info, visit processing.org.
(He only said it like 6 times in the video)
caraxian .. i heard he said java many times but processing its the first time i have heard of .. and it is completely different from what we actually code in java .. so what i meant was , is it a different language or some kind of framework or library.. but now i got the point..
Bibash Katel fair enough
black haired santa... sexy... lol
You should make an erosion simulation as a challenge
Christmas Sweater Alg
Not sure if anyone's commented this yet but it looks like you only randomised the initial particle. Great video though!
Hey, the website doesn't work.
Which url?
@@TheCodingTrain the download coad doesn't work.
Watch a water crystallization and you will guess the best snowflake.
Can't you just call the current particule.show instead of the whole snowflake ? Since it's the only moving part
except he is reloading the background each frame as well which clears the screen, thus he needs to redraw the snowflake. If he took out the part of re-drawing the background then the particles would leave a trail of their entire path
This would be a useful optimization for sure! I suppose by drawing all the particles all the time there is more opportunity for animation, etc.
It's depends on what the goal is, like if you only want to draw a snowflake, but for sure, it could be useful to keep it
@@katherinegaymes There's a way around this. If we display the particle only after it reaches its end position then this issue won't occur.
@@JaspreetSingh-fo2qe yes, but then it loses the animation aspect
hello
Could you try to program this simple game from scratch?
www.humanbenchmark.com/tests/memory
It is about testing your visual memory.
Please suggest here! github.com/CodingTrain/Rainbow-Topics/issues
God will punish you,,, for making me mad about coding....
🙏🙏🙏🙏🙏🙏🙏