Тёмный

Coding Challenge  

The Coding Train
Подписаться 1,7 млн
Просмотров 194 тыс.
50% 1

In this multi-part coding challenge I show how to use a noise field and polar coordinates to create a perfect GIF loop. Code: thecodingtrain.com/challenges...
p5.js Web Editor Sketches:
🕹️ Polar Perlin Noise Loops: editor.p5js.org/codingtrain/s...
🕹️ Perlin Noise GIF Loops: editor.p5js.org/codingtrain/s...
Other Parts of this Challenge:
📺 Perlin Noise GIF Loops: • Coding Challenge #136....
🎥 Previous video: • Coding Challenge #135:...
🎥 Next video: • Coding Challenge #137:...
🎥 All videos: • Coding Challenges
References:
🖋️ Étienne Jacob's tweet: / 1096403588069425152
📓 Étienne Jacob's Blog Post: necessarydisorder.wordpress.c...
🔗 noise() reference: processing.org/reference/nois...
💻 ffmpeg: ffmpeg.org/
🗄 Perlin Noise: en.wikipedia.org/wiki/Perlin_...
Videos:
🚂 Blobby!: • Coding Challenge #36: ...
🚂 Drawing with Fourier Transform and Epicycles: • Coding Challenge #130....
🚂 Heart Curve: • Coding Challenge #134....
🚂 GIF Loop: • Coding Challenge #135:...
🎥 Perlin Noise: • 13: What is Perlin Noise?
🔴 Coding Train Live 169: • Coding Train Live 169:...
Related Coding Challenges:
🚂 #36 Blobby!: • Coding Challenge #36: ...
🚂 #130 Drawing with Fourier Transform and Epicycles: • Coding Challenge #130....
🚂 #134 Heart Curve: • Coding Challenge #134....
🚂 #135 Making a GIF Loop in Processing: • Coding Challenge #135:...
Timestamps:
0:00 Introduce coding challenge
1:35 Let's code
1:45 Recreate coding challenge 'Blobby'
4:18 Add Perlin noise
5:25 Highlight the artifact in the blobby shape
6:30 Illustrate Perlin noise in one dimension
7:18 Explain Perlin noise in two dimensions
8:24 Walk noise space in a loop
9:20 Visualize noise space in two dimensions
10:16 Implement noise in two dimensions
11:41 Refine how noise values change over time
12:21 Experiment with different parameters
14:28 Update how noise values change
17:25 Consider creative possibilities
19:04 Additional notes on the noise space
19:21 Explain noise seed
19:47 Introduce noise in higher dimensions
21:28 Conclude coding challenge
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: ru-vid.comjoin
🛒 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...
#gifloop #perlinnoise #polarcoordinates #p5js #processing

Опубликовано:

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 227   
@DonSolaris
@DonSolaris 5 лет назад
This dude resonates positive energy.
@za_ozero
@za_ozero 4 года назад
radiates maybe
@cameron6464
@cameron6464 5 лет назад
Truly earns his title of "Bob Ross of programming".
@aram285
@aram285 5 лет назад
his new title you just assigned to him.
@alastairlocke4621
@alastairlocke4621 5 лет назад
Which I like
@KundoKun
@KundoKun 5 лет назад
random = happy accidents
@amogh3275
@amogh3275 4 года назад
"Blob Ross" Sorry i had to
@JonathanChute
@JonathanChute 5 лет назад
14:20 - you eluded to an interesting challenge. You should create a program that creates a font based off of this noise so that each time you write down the letter "o" for example you'll get one of these subtly off circles that is constantly different, and then extrapolate that to the entire alphabet so when you type in your keyboard you get the computer "handwriting" your sentence. Each letter would look unique, similar to handwriting, whereas fonts each letter is made exactly equal.
@TheCodingTrain
@TheCodingTrain 5 лет назад
Love this idea! You should make it!
@flameofthephoenix8395
@flameofthephoenix8395 Год назад
Well, this would be great in a video game or something like that, you wouldn't be able to use it as easily for messenger apps, of course you could have it to where it has each person see a different variation of the same text, and no one would likely notice.
@NatetheAceOfficial
@NatetheAceOfficial 5 лет назад
It's dark in the room, quiet. Daniel stirs slightly in his slumber. Suddenly he is sat bolt upright! "Perlin Noise!"
@markimoop9416
@markimoop9416 5 лет назад
It's never dark in the room whenever Daniel's around.
@theromancheezit7982
@theromancheezit7982 5 лет назад
lol this sounds like a creation myth
@willb.755
@willb.755 5 лет назад
You channel is always so exciting! Thanks for all the great content over the years.
@remcodejong2651
@remcodejong2651 5 лет назад
The edits in this video are sooooo good!
@Cosmoandcracker
@Cosmoandcracker 5 лет назад
Dude, I am watching your videos for a while now, and i have never seen someone with this kind of sunshine-happyness while coding. Your videos are great! Keep it like this. Awesome work!
@marcoronzani7197
@marcoronzani7197 5 лет назад
Unbelievable, i needed this kind of thing right now for a project i'm working on, i was going to watch back your asteroids video cause i remember from there something similar, all in all...perfect timing, you are the chosen one!
@user-cb3zx2qv7p
@user-cb3zx2qv7p 5 лет назад
Love your channel. At first it felt to me as "obnoxious youtuber tries to teach basic programming techniques to people who never tried programming". But later you did such an amazing job with some advanced algorithms like quadtree and some machine learning you've earned a lot of my respect. Keep up the good work, dude!
@TechnicJelle
@TechnicJelle 5 лет назад
I just started making an Asteroids game today! Loved the video! Thanks, Dan!
@mehdiikbal1244
@mehdiikbal1244 5 лет назад
Love from France Dan! You are so inspiring and positive. I began coding thanks to you and it was the best thing that could happen to me. Merci beaucoup!!!
@jakehenri9608
@jakehenri9608 4 года назад
I am so glad you finally did this! I have been wondering about how to fix that blob for over a year now!
@erumabo
@erumabo 5 лет назад
Man, I like emotion you put on this, you got a new subscriber.
@DodaGarcia
@DodaGarcia Год назад
Perlin noise is so awesome, I love learning more about it from this channel
@dejoker9042
@dejoker9042 5 лет назад
Im 0 seconds in to the video and the like button is already pressed. Love your videos!
@NatetheAceOfficial
@NatetheAceOfficial 5 лет назад
The edits were so fun!
@waynewedge
@waynewedge 5 лет назад
Very inspiring. Thank you. Once again, I need to go and program my brains out.
@alex_bc
@alex_bc 3 года назад
EXACTLY the information I was looking for! Thank you so much
@Unplanted
@Unplanted 5 лет назад
Kudos to the subtitler! Great work!
@ericschneider4919
@ericschneider4919 5 лет назад
This is fantastic. Cyclic noise feels like the kind of thing a lot of people have wanted and I didn’t realize it existed without summing some sort of time-shifted noise function or some other mumbo jumbo. This is a super elegant solution! I’m wondering if circles would be any better than, say, a square in this context. Surely any closed loop would have this property, but intuitively it feels like a circle is the “most random,” even though something like a square is less computationally taxing. Also, it would be interesting to see what would happen if you put multiple shapes in a perlin noise “field” that acted as a displacement map. If you varied each vertex in a shape by the value of the noise at that vertex, i’d imagine you’d get a really cool effect by moving that shape around or varying the field in 3d. Anyways, great video!
@MahBor
@MahBor 4 года назад
You're such an amazing teacher. I finally understand what 2D perlin noise means.
@listeningcosmos
@listeningcosmos 2 года назад
Was struggling with this problem, thanks for the solution. Tried this method for my music visualizations and it worked well. Now I think I'll try to improve it by adding a sound reacting component to make it interactive.
@iamsushi1056
@iamsushi1056 2 года назад
What an awesome video for inspiration! You could theoretically make a 3d random or self-avoiding walk through spherical coordinates (or a 2d polar random walk) and use that as the coordinates for your perlin noise to be able to just have so many random loops
@markuzj.k9445
@markuzj.k9445 5 лет назад
As always You made it very clear :).thanks.
@wkool9430
@wkool9430 5 лет назад
Great video! You inspired me to make Snake (the game) in JavaScript. The twist is that i am not using any form of grid other than just the loose pixels... It's really close to being done. Thanks again for the inspiring video's
@eideticex
@eideticex 5 лет назад
Never realized this was it's own concept. Used a very similar approach about 6 or 7 years ago to test attenuating light geometry. The renderer I was working on used calculated geometry to represent lights, everything from spheres, cones, toriods to exotic super shapes. After implementing improved perlin noise in HLSL, up to 4 dimensions I was itching to apply it all over the place in the renderer. One of the first things I did was sample noise space at each vertex of the geometry for the lights and passing that into my lighting equations as an attenuation of the radius. Made lights have the familiar imperfection we see in real life and when animated across time, made for very convincing incandescent light sources even though I kept the attenuation so small that the final image showed no more than a delta of 10 in RGB values. Didn't even occur to me while doing that, that I was playing with a rather interesting usage of perlin noise. Then again are there really any non-interesting uses of perlin noise?
@devi_buns
@devi_buns 5 лет назад
Your videos always inspires me ♥
@drsmek
@drsmek Год назад
I love how I found this video and it actually helped me solve a problem I was working on 😅
@scalarnomad9330
@scalarnomad9330 4 года назад
This dude is the best!
@airxperimentboom
@airxperimentboom 4 года назад
I love this !
@paulusul
@paulusul 5 лет назад
Perlin noise is always positive That made me really happy :)
@jolly8953
@jolly8953 4 года назад
this channel is a real inspiration for stuff to do lol
@porknwithbill
@porknwithbill 5 лет назад
I love how human and practical your code is. We don’t have to talk about the semi colons
@kenan2386
@kenan2386 3 года назад
How does he have all of that energy Keep up your work!
@iamjimgroth
@iamjimgroth 9 месяцев назад
This guy is amazing!
@iwantedtohaveabigytnamepsi2007
Omg, that's so amazing
@monochromatech
@monochromatech Год назад
Hey I just found your channel and I love it.
@cielregister8828
@cielregister8828 5 лет назад
good video Dan!
@mujaahidhaywood9843
@mujaahidhaywood9843 5 лет назад
I swear Mr Shiffman, you acknowledge every comment. Thanks for another intriguing video.
@TheCodingTrain
@TheCodingTrain 5 лет назад
I do miss a few!
@BIG_CLARKY
@BIG_CLARKY 4 года назад
This guy has crazy math/science teacher vibes
@granteadie2616
@granteadie2616 3 года назад
you're a national treasure my friend 10/10
@kushagraverma9452
@kushagraverma9452 5 лет назад
Nice editing!
@user-xb5uu5sk2k
@user-xb5uu5sk2k 2 года назад
Great video!
@edwinjones134
@edwinjones134 3 года назад
Best teacher on the internet
@kautukkundan8001
@kautukkundan8001 5 лет назад
Just amazing
@kreuznachpham1208
@kreuznachpham1208 5 лет назад
Amazing. Thank you so much
@JBahrsShiz
@JBahrsShiz 5 лет назад
First of all, you rock. Thank you for your videos. As a newbie, I feel overwhelmed, but inspired by your videos. I guess it's like someone learning to play the drums and watching Neal Pert thinking, 'I have a long way to go' and 'man, that's awesome' all at the same time. What is your advice to the noob? I am currently more than half way through the codecademy full stack web development course and plan to finish that, but was curious to hear from the community what "best practices" are recommend for new guys/gals.
@jazonjiao638
@jazonjiao638 5 лет назад
Awesome! Finally fixed the broken blobby!
@roykepoyke
@roykepoyke 3 года назад
That is my favorite video of yours
@d_v_d1070
@d_v_d1070 5 лет назад
18:03 in he plays the cards and lures you in with that oneliner, your passion for code ignites "if......the creative possibilities expl...." o yeszz :)
@poplikes
@poplikes 2 года назад
brilliant!
@hendasheng
@hendasheng 3 года назад
thank you for your help:)
@aaronrothwell7615
@aaronrothwell7615 5 лет назад
This is a really fun one to add alpha clearing to, so you get blurred lines as the shape morphs. So instead of background(0) you would use color(0,0,0,25); rect(0,0,width,height); and this will draw a rectangle over the entire screen that is slightly faded out and because these are layered on top of each other each previous generation of line is more blurred out and so slowly transitions to black. Hopefully this makes sense, not sure how to format code in comments.
@deadend8111
@deadend8111 5 лет назад
Nice video!! I challenge you to make a drawing predictor (simple neural network that calculates the next points locations from few starting points)
@DustinGunnells
@DustinGunnells 5 лет назад
I don't know what you found here, but I'm still studying it. I think you found something extremely important on accident. That phase thing is incredible!
@JNCressey
@JNCressey 5 лет назад
As the phase changes, the orbit of (cos(A+phase), sin(A)) over A morphs as follows: Phase=0: counterclockwise circle Phase=pi/2: oscillating along the straight line between (1,-1) and (-1,1) Phase=pi: clockwise circle Phase=3pi/2: oscillating along the straight line between (-1, -1) and (1,1) And between those, it is various elliptical shapes.
@aram285
@aram285 5 лет назад
Polar Perlin Loops, part of a balanced developer’s diet. edit: oops I did a mispelliginationating but its fixed now
@ABaumstumpf
@ABaumstumpf 5 лет назад
But he didn't use Perlin noise.
@ABaumstumpf
@ABaumstumpf 5 лет назад
@Manan Karnik No, it is *not*. IN processing and p5js at the very least it returns a fractal noise - that is NOT Perlin noise. Fractal noise is a form of noise generated by adding several different noises together. In case of processing/p5js that becomes apparent when you look at the "NoiseDetail" function: It set the number and falloff for the used noise-layers. Perlin Nosie itself is a very regular grid-based noise with uniform feature size and smooth transitions. Adding several layer of that with decreasing size and amplitude gives the nice rugged result that resembles a terrain.
@aram285
@aram285 5 лет назад
@@ABaumstumpf It was a joke k dude. Calm.
@Dalendrion
@Dalendrion 5 лет назад
According to the documentation, it's Perlin noise. processing.org/reference/noise_.html It is of course possible that the documentation is wrong. If it is, it's understandable where the confusion comes from.
@pinkierar_real
@pinkierar_real 5 лет назад
Потрясающе
@Wobbern
@Wobbern 5 лет назад
You would be a great teacher! I can tell it on the way you leave the mouse in the middle of the images you want to show.
@prakharlondhe3876
@prakharlondhe3876 5 лет назад
he is a *professor*
@Wobbern
@Wobbern 5 лет назад
​@@prakharlondhe3876 and this was a *joke*
@JackLaidlaw
@JackLaidlaw 5 лет назад
Wonderful
@johnterpack3940
@johnterpack3940 5 лет назад
It looks like the perfect technique for modeling a realistic planet. Just apply the exact same technique to spherical coordinates instead of polar coordinates. Maybe add a couple octaves of additional noise or an underlying sine wave pattern to help create larger scale areas like continents. At any rate, it certainly gives me a better idea of where to start than anything else I've found. Thank you.
@elyaizen
@elyaizen 5 лет назад
Wow Dan. 👏
@AidanNorde
@AidanNorde 5 лет назад
wow awesome
@slyer7695
@slyer7695 5 лет назад
Love from Italy ❤️♥️🇮🇹, #LoveFromItaly5
@mahirdaiyansafwaan2148
@mahirdaiyansafwaan2148 5 лет назад
Awesome
@WildAnimalChannel
@WildAnimalChannel 5 лет назад
I use 3d fractal noise to make mountains on the 2D surface of planets in my game I'm making. You're giving away my secrets!
@cellininicholas
@cellininicholas 5 лет назад
As well as changing the Z-Offset, could you also move the centre of the circle (that is sampling values in 2D perlin noise)? You could also play with that circle in other ways... Maybe use an oval and slowly change it's shape over time?
@turnipzoxi2853
@turnipzoxi2853 5 лет назад
Chaotic good coding.
@user-nl3xs7xv8x
@user-nl3xs7xv8x 2 года назад
Супер. Вы крутой!
@hund4440
@hund4440 4 года назад
You can get a 2d tileable perlin noise texture by cutting a thorus through 3d perlin noise
@pdutube
@pdutube 5 лет назад
The segment at 16:34 looks like the continent of Antarctica is morphing with Earth's rotation. Trippy. Another cool way to implement 3+ dimensions is to make the extra dimensions color based or sound based. Then a rotation/translation/etc., would change colors and sounds.
@TheCodingTrain
@TheCodingTrain 5 лет назад
Please try this!
@monlewi1976
@monlewi1976 5 лет назад
Perfect spin loader
@aryamankejriwal5959
@aryamankejriwal5959 5 лет назад
Anyone else remember the debate about whether it was polar noise, perlin noise, polin noise or perlar noise?
@azomtech4852
@azomtech4852 5 лет назад
wonderful wonderful wonderful wonderful wonderful wonderful wonderful wonderful wonderful wonderful wonderful wonderful
@VictorNascimentoo
@VictorNascimentoo 5 лет назад
Do a next challenge on Hilbert Curves and other space filling curves :)
@abdelrhmandameen2215
@abdelrhmandameen2215 3 года назад
I’m here for the hands gestures.
@praveshgaire3437
@praveshgaire3437 5 лет назад
Never though noise would be that useful
@inusahrauf1810
@inusahrauf1810 5 лет назад
very good video
@inusahrauf1810
@inusahrauf1810 5 лет назад
Please how do i build my own live video streaming website in my shared hosting Cpanel?
@Confuseddave
@Confuseddave 5 лет назад
I was thinking about whether you could make a seamless 2-dimensional texture (there was a video were you used Perlin noise to create a vector field and had particles flow through it, but it had artefacts at the edges where the vector directions would change abruptly). My first thought was to use the surface of a 3D torus to give a looping 2d texture in the same way you're using the edge of a 2D circle to generate cyclic 1D noise here. Then I twigged that the would cause distortion in the texture, since the outer edges of the Torus would sweep through a larger length of the noise pattern than the inner surface for the same angle. You could minimise it by turning the minor circle so it's tangent to the major circle rather than radial (so your torus would be flattened as if you sucked all the air out of it) but it'd still have a slight distortion to it unless you actually projected the circle onto the surface of a cylinder (sounds complicated, but probably just needs the coordinate calculations to come in the right order). Part of me wonders if it would be simpler just to write a Perlin noise class that interpolates smoothly between the edges, but that would limit the scale of the noise to integer fractions of the screen space, and might cause issues if you wanted to create images with odd aspect ratios.
@mohamedmorh
@mohamedmorh 5 лет назад
First comment love you bro
@vadsavin
@vadsavin 5 лет назад
Do you remember your Perlin noise example with moving particles? Please, try to make the same staff but let particles move like drawing contours of input image.
@execskies4245
@execskies4245 2 года назад
Now I want to see rolling Perlin noise
@SaifUlIslam-db1nu
@SaifUlIslam-db1nu 5 лет назад
Is there any possible chance you can arrange to teach professors and teachers how to make animations like this? Your graphics really help to understand Mathematics and Physics. I think it would help quite a lot in the class room!
@diligar
@diligar 5 лет назад
What if, when moving through 3D Perlin space, instead of looking at circles in x,y with increasing z, you looked at circular cross-sections of a torus? Then it’d definitely loop :D
@Mortagus
@Mortagus 5 лет назад
Wiggle wiggle wiggle 😛
@pluffcrock3438
@pluffcrock3438 2 года назад
21:35 that shooting sound resonates in my nose
@valseedian
@valseedian 5 лет назад
Periodic sequences repeat at known intervals; or, misidentifying randomness: a short tutorial.
@anthonytonev1357
@anthonytonev1357 5 лет назад
Welcome back to Polar Perlin Noise Loop Thing of a Blob
@orpheus0108
@orpheus0108 5 лет назад
that's how perlin noise works💁‍♂️
@user-hi6jn4mw2o
@user-hi6jn4mw2o 10 месяцев назад
/** 적외선 센서에 물체가 감지되면, 시리얼 모니터에 "Detected"라는 문장을 출력*/int sensor = A0; // 센서핀은 A0번에 연결int val;void setup() { Serial.begin(9600); pinMode(sensor, INPUT); // 센서값을 입력으로 설정 Serial.println("arduino starts");}void loop() { val = digitalRead(sensor); // 센서값 읽어옴 if (val == LOW) { // IR센서는 LOW ACTIVE로 탐지 시 LOW값을 전송함 Serial.println("Detected"); delay(300); } else Serial.println("0"); delay(300);}
@DotNetRussell
@DotNetRussell 5 лет назад
This would be cool to use to generate random terrain
@TheCodingTrain
@TheCodingTrain 5 лет назад
See: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IKB1hWWedMk.html
@KnakuanaRka
@KnakuanaRka 4 года назад
Okay, the gag at 6:02 is hilarious. ¯\_(ツ)_/¯
@__mk_km__
@__mk_km__ 5 лет назад
During your explanation I had another idea. What if we take 1D perlin noise, then take the end points, draw a line between them, and then shear the entire graph, so the line stays perfectly flat. Essentially, when we take the noise value, we subtract some amount from it. That amount ranges from the start point value at t=0 and the end point value at t=1. Just simulating it in my brain, I don't think it would be noticeable
@JonDavies-Shiftbulk
@JonDavies-Shiftbulk Год назад
Continuously good videos. Can you do one with the polar noise mapping seamlessly to a sphere. it is tricky as you change the radius the polar mapping the noise texture distorts.
@TheCodingTrain
@TheCodingTrain Год назад
Oh I would love to try this!
@georhodiumgeo9827
@georhodiumgeo9827 4 года назад
Did he just project 3D, 2D perlin noise into a 1D line projected onto a 2D picture taken into the third dimension! I am happy this didn’t cause the universe to explode but I don’t know how much more of this it can take!
@nicolashelios8556
@nicolashelios8556 5 лет назад
♥️♥️♥️🤗
@DanilaBou
@DanilaBou 4 года назад
While moving through 3D perlin map with zoff, does it loop? Because now that we are moving in a straight line on the z axis, the values will not repeat their initial values
@hoya0690
@hoya0690 Год назад
아자씨 구여워염!
@AuraVFX
@AuraVFX Год назад
how do you make the noise loop follow a certain shape like the heart you showed in the start
@jedmarshall217
@jedmarshall217 5 лет назад
What if you moved where you were getting your perlin noise valises from, instead of moving around the circle? Say, having the circle trace around another circle in the perlin plain? Seems like this might be a cool way to add some more “randomness” to the space without having repeats before the end.
@ahmedsharif9193
@ahmedsharif9193 3 года назад
Actually, negative values for xoff & yoff are supported in the p5 Perkins noise function
Далее
Coding Challenge #136.2: Perlin Noise GIF Loops
26:25
Coding Worley Noise
15:40
Просмотров 116 тыс.
Викторина от МАМЫ 🆘 | WICSUR #shorts
00:58
Coding the Collatz Conjecture
23:08
Просмотров 131 тыс.
Coding Challenge 166: ASCII Text Images
22:42
Просмотров 1,1 млн
Programming Perlin-like Noise (C++)
27:54
Просмотров 103 тыс.
Coding Marching Squares
26:28
Просмотров 178 тыс.
3.4 Polar Coordinates - The Nature of Code
16:34
Просмотров 44 тыс.
Coding Challenge #86: Cube Wave by Bees and Bombs
30:09
The Theory of Noise: An Overview of Perlin Noise
6:19