Coding Challenge #24: Perlin Noise Flow Field

  Рет қаралды 366,214

The Coding Train

The Coding Train

Күн бұрын

Пікірлер: 296
@ilustrado7291
@ilustrado7291 8 жыл бұрын
I can't stop watching your videos man!
@ilustrado7291
@ilustrado7291 8 жыл бұрын
ProCactus Hahaha! Exactly, my man. These concepts and ideas are really interesting - and his energy and enthusiasm reminds me of the "perfect" college professor. Hehe. He's really fun. I remember 2 quotes: "The secret to creativity is knowing how to hide your sources" and "Steal like an artist". We'll stand on the shoulders of giants! ;)
@ilustrado7291
@ilustrado7291 8 жыл бұрын
***** ProCactus Hahaha! Nice! If you guys are on github (which is a must), you can upload your codes there so that we can all learn together. ;) Have fun guys!
@abara5678
@abara5678 8 жыл бұрын
Me neither and i have never even written one bit in any Coding Language =)
@HenriqueMRocamora
@HenriqueMRocamora 8 жыл бұрын
I KNOW THAT FEEL
@hiperesp
@hiperesp 6 жыл бұрын
Me2 haha
@emilybjoerk
@emilybjoerk 8 жыл бұрын
You are computing the whole vector field every frame even though you only use a fraction of the vectors. Give the perlin noise function as an argument to the vector follow function and compute the flow vector once per particle instead. It should improve your performance significantly and make it independent of the resolution and only depend on the number of particles.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
Really great point, thank you.
@PhilBoswell
@PhilBoswell 7 жыл бұрын
A minor extra optimisation could be to save the calculated vector in the flowfield array so that particles in the same square can share it, assuming that wiping the array on each cycle doesn't slow things down again.
@drewjamesandre
@drewjamesandre 7 жыл бұрын
Hey Emily, I see what you mean here! Nice tip. There is a lot of empty space that isn't actually touched by any particle, and it would make sense for each particle to calculate the vector of the "cell" it is currently occupying. I'm confused about one thing though. If the flow vector is only calculated once per particle, it seems like it would become less of a "flow field" and more of individual particles moving along a perlin noise defined 2d path, totally separate from other particles. Is that how you see it? So if two particles are close to each other, it may loose that appearence of a flow field?
@Moll-ayyy
@Moll-ayyy 6 жыл бұрын
Drew André I'm not totally sure, but I'd imagine that all the particles would still behave like they all exist in the same flow field because they all access the same noise space, and the zoff variable would be changed globally. I think.
@small_thoughts
@small_thoughts 6 жыл бұрын
ill do it soon
@nagesh007
@nagesh007 2 жыл бұрын
Thanks a lot
@abara5678
@abara5678 8 жыл бұрын
Man i love this guy´s attitude and character =). So excited about what he is doing and a real sense of humor!
@RicoGalassi
@RicoGalassi 5 жыл бұрын
Just watching some of your older videos Dan. Makes me wish I had you as a comp sci professor in college. I would've loved it so much more
@IARRCSim
@IARRCSim Жыл бұрын
Definitely. It is great he's sharing on youtube too, though. youtube reaches a lot more people and mostly people who are actually looking for content like his. Computer science students often need to take whatever class they're in if they want to graduate so the level of enthusiasm for what is taught tends to be lower.
@J_Abad
@J_Abad 8 жыл бұрын
Instead of setting a max speed you could create a viscous friction force so that it's proportional to the particle's speed, that way everything will behave more like a fluid
@Algebrodadio
@Algebrodadio 8 жыл бұрын
When your particles 'wrap around', you're giving their position space a toric symmetry. But the perlin noise doesn't have the same symmetry so it will be discontinuous at the boundary of the canvas.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
Oh, this is a very good and important point, thank you!!
@Algebrodadio
@Algebrodadio 8 жыл бұрын
I love these videos - don't change a thing!
@erispe
@erispe 3 жыл бұрын
Is this why the particles are getting stuck at the canvas border?
@ColinPaddock
@ColinPaddock 3 ай бұрын
Using a 3d Perlin evaluated on a toroidal surface could potentially help here. Or continuously creating new particles at random locations as particles fall off of the edges.
@frmcf
@frmcf 2 жыл бұрын
I'm feeling so pleased with myself right now, because I followed through the first two thirds of the tutorial and then took it from there and came up with a lot of Dan's solutions by myself. I feel like a big boy who just used the toilet without any help for the first time.
@adilrabbani3562
@adilrabbani3562 6 жыл бұрын
Hey Dan! I like watching all your videos and wish I had a teacher like you at my University. You explain the most convoluted of things in a very fun and easy way. Taking them part by part. I am really thinking of applying for the Masters program at NYU after watching your videos.
@70TakeAway1
@70TakeAway1 8 жыл бұрын
I'm an accounting major but can't seem to stop watching your videos even though I understand absolutely nothing. Great work.
@vaguebrownfox
@vaguebrownfox 3 жыл бұрын
"Ugh you're back, great!" gotta love Shiffman
@mctuble
@mctuble 8 жыл бұрын
These are by far my favorite coding videos and are getting me interested again in coding. Thank you for that.
@ColinPaddock
@ColinPaddock 3 ай бұрын
Another variation on the display, although probably not fast, would be a population density map of the region. For each pixel in the display, count the number of particles within some distance of that point. Using grayscale, you could display white where the number is maximal and black where minimal. I think calculating the raw density values would be O(w*h*n), where w is the width of the screen in pixels, h is the height of the screen in pixels and n is the number of points. This could be reduced if the points were in a quadtree to an average of O(w*h*r*log n), where r is the average number of points in a region. If the regions are small enough that r
@ya64
@ya64 8 жыл бұрын
I just found this channel and learned so much already. I think Perlin Noise is my new favorite thing and can't wait to start playing with it!
@gloverelaxis
@gloverelaxis 5 жыл бұрын
This is the funnest code-related channel out
@marco_gallone
@marco_gallone 6 жыл бұрын
This was my favourite illusion yet! This would look so cool if it were a candle blow out animation. You should keep it exactly as is but delete (or let the alpha fade out over time) previous points so that it creates a more dynamic smoke effect!
@likeyou3317
@likeyou3317 6 жыл бұрын
This is the most beautiful thing I've seen this day, shame on me that I haven't checked all of the coding challenges yet..
@EricDiazMD
@EricDiazMD 8 жыл бұрын
Awesome! First video of yours that I've seen. I learned a lot. I hope you keep doing these. Thanks for what you've done so far.
@theetherbelow
@theetherbelow 2 жыл бұрын
Was looking for inspiration for generative art for pen plotting and this video is still useful, 6 years later. Thank you!
@stephenwalsh1006
@stephenwalsh1006 8 жыл бұрын
Thank you very much for this series! You are a very talented teacher
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+Stephen Walsh thank you for watching!
@anthonyikedakolar9375
@anthonyikedakolar9375 8 жыл бұрын
dude you are blowing my mind
@phoebebaker1575
@phoebebaker1575 6 ай бұрын
Just your quick sketch looks really cool. And the rest, too.
@leberkassemmel
@leberkassemmel 8 жыл бұрын
I like you. You make your code big enough, so even with a resolution of 144p i can still read it. I know, i should get faster internet. But it is so expensive!
@sallerc
@sallerc 8 жыл бұрын
Wow, that's dedication... I couldn't bare to watch anything in 144p :)
@leberkassemmel
@leberkassemmel 8 жыл бұрын
salle rc Yes. But imo it is not worth 50$ a month more just to watch them in 360p...
@sallerc
@sallerc 8 жыл бұрын
Michi Lo Ah I see. That's expensive, where do you live?
@leberkassemmel
@leberkassemmel 8 жыл бұрын
salle rc Germany. Bavarian Forest. Nowhere near other civilisation.
@sallerc
@sallerc 8 жыл бұрын
Didn't realize it's that expensive in Germany, but guess the "nowhere near civilization"-part has something to do with it :) You should move to Sweden, I pay like 15EUR/month for a 100MBit connection.
@rebnoz5356
@rebnoz5356 8 жыл бұрын
I don't know anything about programming, but stil I'm watching your videos, because you're so excited about it. 😅
@JesseUnderscoreMartin
@JesseUnderscoreMartin 8 жыл бұрын
Philip Merian Why not start learning now? Daniel has a ton of great videos for beginners!
@kenan2386
@kenan2386 3 жыл бұрын
@@JesseUnderscoreMartin Yea i agree Rebnoz should learn coding! Its not hard and is more than good to learn!
@Yutte3k
@Yutte3k 3 жыл бұрын
Not sure if someone has said this yet, A problem that I've seen is that when you draw the line from prevPoint to pos, there's some overlap of the lines, which if you're using alpha will produce circles at each of the points where the line is drawn. If you have a maxspeed which all of the particles reach, they end up creating dots at a uniform distance from each other. A fix that I think works is to add "strokeJoin(MITIR)" which makes all of the points at which the strokes join a flat line instead.
@nofacee94
@nofacee94 8 жыл бұрын
Nice video. Optimization tip: You can create the paths with moveTo() and lineTo() (or with the line() function you are using) inside the for cols and for rows loops and then draw them with stroke() afterwards, outside of the loops; this will render it much faster - by rendering all the lines once instead of for each line. Bear in mind it will be a continuous line, so you will have to use moveTo to take the 'pen' off of the canvas and put it to the next line position. moveTo(xa,ya) e.g. 0,0 lineTo(xb, yb) e.g. 0,1 then update xa,ya and xb,yb with the next line positions inside the for loops and repeat. The call stroke() outside the loooops.
@Hyuts
@Hyuts 6 жыл бұрын
I like the video as fast as my cursor can get to the button. Succinct as always. Thank you.
@rosslahive
@rosslahive 5 жыл бұрын
This is really good stuff man.
@danielk1560
@danielk1560 4 жыл бұрын
Thank You! Great video. Fortunately, I didn't have these performance issues... Was running it on 1920x1080 at 5 particles and got stable 80 fps!
@px64
@px64 4 жыл бұрын
I was running in 4k with half a particle, same with me! , no lag at all..
@stanger963
@stanger963 6 жыл бұрын
"There's a bunch of few different things" xD
@juan_w_fer
@juan_w_fer 8 жыл бұрын
Daniel, I must thank you and KZbin's new algorythm for recommended videos. Although I have some knowledge of Arduino and Python, this is the more interactive environment I want to have when coding(Battleship, Conway's game of life aren't that fun using print() in Python lol). Now I'm going to start watching your Processing playlist. Thanks, your videos are really nice to watch.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
So glad to hear, thank you!
@jesuschrist6979
@jesuschrist6979 7 жыл бұрын
Juan Fernández try JavaScript learn native first then go to p5 for game development
@dawnstar24
@dawnstar24 7 ай бұрын
25:42 the people laughing in background feels like he is doing a comedy skit.
@meikurogame9595
@meikurogame9595 8 жыл бұрын
I swear to God I want that t-shirt so bad hahaha. You're always so fun and interesting to watch, keep up!
@thomaswaller4517
@thomaswaller4517 8 жыл бұрын
That is a really nice program. Good job mate.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
Thank you!
@thomaswaller4517
@thomaswaller4517 8 жыл бұрын
I have a question, I want to build a Indie game, with sound, and good graphics, and I want to code the whole engine myself, not use unity or anything, what language should I be using for such task? It's a Puzzle Platformer, and some creature like enemies will be in the game.
@JohnDoe_1237
@JohnDoe_1237 7 жыл бұрын
0:06 omg nice, this looks great :D
@kevnar
@kevnar 6 жыл бұрын
The crux. Such a great word.
@SpringySpring04
@SpringySpring04 3 жыл бұрын
I can't get over the fact that there are random sitcom laughter clips playing in the background at some points of the video lol
@kairotox
@kairotox 5 жыл бұрын
I was trying to figure out a way to make the smoke like lines fade over time, and I'm not really a programmer, so I'm really just spitballing here, but one option might be to have the smoke draw on a transparent white layer that also draws every time the program draws. So every time it's adding a bit of white to everything that wasn't just drawn, eventually making old lines fade out. There's probably a better way to do it, and I'm not sure if my way would even work.
@onnio7998
@onnio7998 2 жыл бұрын
I got wayy into optimizing this. I can simulate 50 000 particles for 500 iterations in a second. The color of the traces can be dynamically changed. Thinking of making a video of it at some point.
@krccmsitp2884
@krccmsitp2884 2 жыл бұрын
Would be great to see that video and code.
@aurelianobuendia24
@aurelianobuendia24 7 жыл бұрын
Im the only one hearing those creepy laughs ?
@zahidahmed586
@zahidahmed586 6 жыл бұрын
AHHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHH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HAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHHAHAHAHAHHAHAHAHAHAHHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAH
@marcthompson647
@marcthompson647 6 жыл бұрын
No you aren't
@pflintaryan8336
@pflintaryan8336 5 жыл бұрын
i think they are having party next door.
@whatever13579
@whatever13579 Жыл бұрын
I feel like people are making perlin noise in the background
@tranceemerson8325
@tranceemerson8325 5 жыл бұрын
cool you could use this to tell the particles to carve values off of a heightmap over time.
@Simmonsstummer
@Simmonsstummer 3 жыл бұрын
Ok this was amazing
@NinJaTurtleSplinter
@NinJaTurtleSplinter 8 жыл бұрын
21:20 for a second i thought hes not wearing pants
@redpepper74
@redpepper74 4 жыл бұрын
Oslo Cloonson Yep, I did a double-take too. Deception 100
@lemonlordminecraft
@lemonlordminecraft 7 жыл бұрын
I went back and watched them. Now I'm here.
6 жыл бұрын
25:00 the force is strong with this one
@alexandralazarevski3265
@alexandralazarevski3265 8 жыл бұрын
where is this video on wind flows based on geo locations! !! Dying to see this!
@karanverma1
@karanverma1 8 жыл бұрын
thanks a lot for such amazing stuff... looking forward for upcoming videos
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
Thanks for watching!
@Stoupik
@Stoupik 8 жыл бұрын
Hi Dan. First of all, I love your videos. They really brought me to Processing and I became kind of obsessed with it. :) I really appreciate relatively simple code and outstanding results! But to this very coding challenge. I believe there's a bug in your edges() function (if not, please someone correct me). I am probably more unlucky than you were when you ran your program and my particles tested the edges to the limit. :) Your particles are allowed (due to edges method implementation) to have *y* values in a range ** (including border values. This was causing IndexOutOfBoundException when one of the particles was right on the edge (had y = height). In those instances the formula for flowfield's index (*x + y * cols*) gave invalid index. For example (pseudocode) size(400, 400); scale = 20; rows = cols = 400 / 20 = 20; flowField.length = 400; // index in the range from 0 to 399 particle = new Particle(200, 400); // particles coors in the grid col = 200 / 20 = 10 row = 400 / 20 = 20 index = col + row * cols = 10 + 20 * 20 = 410 => invalid index So the edge() function should be private void edge() { if (position.x < 0) { position.x = width - 1; } if (position.x > width - 1) { position.x = 0; } if (position.y < 0) { position.y = height - 1; } if (position.y > height - 1) { position.y = 0; } } Keep those videos coming, they are really fun and full of brilliant ideas. Thanks!
@Pingoooeen
@Pingoooeen 4 жыл бұрын
Love it! Even though what you did in the end was pointless
@stephenkrus
@stephenkrus Жыл бұрын
Wow! 🤩
@exdcode3369
@exdcode3369 8 жыл бұрын
You are so awesome!!! And I'm not even learning or using JavaScript!) might try to apply some of your challenges to Java, but not sure still if will be able to)
@gm_000
@gm_000 8 жыл бұрын
I do not understand 25:30 - Why do the vectors mostly point toward left? And why multiplying by 4? If noise returns between 0 and 1 and we multiply by 2PI we should have already the correct values... What am I missing?
@ronnetgrazer362
@ronnetgrazer362 5 жыл бұрын
When the increment variable was set to 1, all the tiles were mid grey. He then changed it to 0.1, and he got more variation, but nowhere near a range between black and white.
@iminni3459
@iminni3459 5 жыл бұрын
The values tend to be around 0.5 so if you multiply by 2PI they will tend to be around PI (which is the left direction).
@Kitulous
@Kitulous 5 жыл бұрын
@@iminni3459 Does this have to do something with the Gaussian distribution?
@iminni3459
@iminni3459 5 жыл бұрын
@@Kitulous maybe I'm not really sure
@AB-Prince
@AB-Prince 6 жыл бұрын
You could also give a velocity to each vector by giving a w to the perlin noise and using it as a velocity
@deenchen4822
@deenchen4822 10 ай бұрын
The way the particles are limited with a maximum speed reminds me of how light is limited as the object with the maximum speed in the world.
@emrenitim83
@emrenitim83 3 жыл бұрын
Thank you, great video
@ResanChea
@ResanChea 5 жыл бұрын
do you do these tutorials for the processing version? because i want to start learning processing more but most of the interesting projects are on p5js
@MrGuillaume343
@MrGuillaume343 8 жыл бұрын
10:40 shouldnt the zoff be out of the loop? greats videos !!
@giganooz
@giganooz 7 жыл бұрын
guillaume pauget XD yes it should
@giganooz
@giganooz 7 жыл бұрын
guillaume pauget This video is full of mistakes and inefficiency but that also makes it upgradable which is a nice thing.
@noahmccann4438
@noahmccann4438 7 жыл бұрын
Very cool effect. Have you considered doing a coding challenge based around a Navier Stokes fluid solver? Those seem quite similar to the flow fields you’re demonstrating here, however you can have the fluid (equivalent to the particles in your example) affect the flow field - similar to real fluids, rather than relying on Perlin noise to drive the field. My apologies if you’ve already done this in another video - I couldn’t find one with a quick search.
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
I have not but this is a great idea!
@kevnar
@kevnar 5 жыл бұрын
There's a typo in your github code for this project, in the flowfield class. void update() { float xoff = 0; for (int y = 0; y < rows; y++) { float yoff = 0; for (int x = 0; x < cols; x++) { float xoff = 0 is resetting the y loop, and vice versa. (Processing version)
@yasiin_miim
@yasiin_miim 8 ай бұрын
8:57 you are a great loving tecaher Daniel :)))
@definty
@definty 3 жыл бұрын
You could use the Simplex Noise algorithm its more effcient and does the same thing.
@alexpraturlon1873
@alexpraturlon1873 8 жыл бұрын
+Danial Shiffman Love the videos. I enjoy following along using processing and learning a bunch including the converting from P5 to processing.
@aurelb62
@aurelb62 8 жыл бұрын
I think the previous position is always the same position as "pos". In the 'update' function, you should apply 'updatePrev' before adding vel to pos.
@jialiu518
@jialiu518 8 жыл бұрын
n dimension Perlin noise = the sound of minds being blown right now
@NicolaiWeitkemper
@NicolaiWeitkemper 5 жыл бұрын
Might be a nice screensaver
@CharIie83
@CharIie83 7 жыл бұрын
really impressive
@bono95zg
@bono95zg 8 жыл бұрын
love how detalied the tutorial is haha
@MrLemonsplash
@MrLemonsplash 6 жыл бұрын
"So I'm moving through time a little bit too quickly". This is a normal quote from a completely normal person that didn't use drugs 10:40 minutes ago
@PrivateIsleProductions
@PrivateIsleProductions 7 жыл бұрын
excellent work
@skydeng1647
@skydeng1647 8 жыл бұрын
learn a lot, thank you !!!
@possumcode
@possumcode 7 жыл бұрын
That is sooooooooooo cool !
@nukiolbartes6279
@nukiolbartes6279 3 жыл бұрын
Whats the algorithm for the audio background noise?
@brothajonze
@brothajonze 2 жыл бұрын
Just brutal watching this guy fumble and stumble over text that brackets his life.
@kennys1881
@kennys1881 6 жыл бұрын
@0:38 the good feeling when u really do it..
@puffolino1
@puffolino1 8 жыл бұрын
You should have names the edges function border control :P
@dannydk6
@dannydk6 8 жыл бұрын
Luca Muscat clever
@joecamroberon9322
@joecamroberon9322 5 жыл бұрын
Or “portal control” since they are teleporting to the opposite side.
@sehyunkim4736
@sehyunkim4736 7 жыл бұрын
It's bunch'a cool stuff!
@anonymousstudent5871
@anonymousstudent5871 7 жыл бұрын
WHY it is "createP is not defined"and "particle is not a contructor" keep showing up in my console?
@polacknil5047
@polacknil5047 Жыл бұрын
Does this mean processing is way more efficient than P5 ?
@linchen7258
@linchen7258 6 жыл бұрын
Thank you soooo much!! I really like Perlin noise! And I tried to follow the processing you upload in the Github...Can I ask why the effect is different from the version of p5js? sorry about the stupid question, I am just the beginner...
@theom3050
@theom3050 8 жыл бұрын
I can't seem to find the processing version on github, have you upploaded it?
@torwine4895
@torwine4895 2 жыл бұрын
Thanks a lot :-) Now i make beautifull pictures in Java. That's a nice playground.
@Mustafaismail22
@Mustafaismail22 8 жыл бұрын
thanks 😘
@Eddytorial
@Eddytorial 6 жыл бұрын
even i really like what's going on here i kinda wondering what happening next room, must be something really funny :)
@msoulforged
@msoulforged 5 жыл бұрын
Yay we drew the hairs in the drain!
@robloxfan60
@robloxfan60 8 жыл бұрын
Hi, Dan. Could you do a short tutorial on how you set up your local server? Maybe just a quick few minutes at the beginning of the next stream? Thanks a lot!
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
take a look at: kzbin.info/www/bejne/i3Srq5-Lnql3Z5I
@robloxfan60
@robloxfan60 8 жыл бұрын
Brillinat, thanks so much!
@kps2642
@kps2642 7 жыл бұрын
i like your videos man , but i am too busy with with c++, can i do this in c++ ? i do plan to learn JS in the future
@robogaming3045
@robogaming3045 5 жыл бұрын
And remember kids: Shiffman is a particle
@arunprabhu8120
@arunprabhu8120 4 жыл бұрын
Sorry for such a silly query, but shouldn't zoff be incremented outside the y loop?
@kocaksaid
@kocaksaid 7 жыл бұрын
"We need to talk, meet at this camera. Actually never mind." -Shiffman 2017
@emergingbits
@emergingbits 2 жыл бұрын
my computer just lags when I try to follow these instructions line by line midway through the video. not entirely sure how others are doing.
@danrobinson1729
@danrobinson1729 8 жыл бұрын
This is so rad. I'm loving your books Dan.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
Thanks for the nice feedback!
@nane1890
@nane1890 8 жыл бұрын
omg! you're awesome!!!
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
Thanks for watching!
@Marcello30able
@Marcello30able 8 жыл бұрын
Hey! Quick question, is it possible to tie the flow fields speed to a microphone input?
@JesseUnderscoreMartin
@JesseUnderscoreMartin 8 жыл бұрын
Marcello30able Anything is possible. forum.processing.org/one/topic/how-can-i-detect-sound-with-my-mic-in-my-computer.html
@sariaghaziri6448
@sariaghaziri6448 6 жыл бұрын
I love your videos! But here I am struggling trying to decode your code from P5 to P3, any tips? I couldn't find a challenge done on P3!
@tobyzxcd
@tobyzxcd 8 жыл бұрын
This was Uploaded on my birthday, Man... June 27th is an awesome day
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+Toby Brooks happy belated!
@tobyzxcd
@tobyzxcd 8 жыл бұрын
Thanks Dan, and Thanks for the Great Video !
@WhiteIce2112
@WhiteIce2112 8 жыл бұрын
Toby Brooks we share the same birthday.
@Nulono
@Nulono 8 жыл бұрын
12:34 *to the velocity
@bevkcan
@bevkcan 8 жыл бұрын
I want to do a colorful version in 3d space that rotates around the origin. Welp, time to learn processing.
@bevkcan
@bevkcan 8 жыл бұрын
I made some sort of cube that has set length random directed 3d lines in every scl in every axis. I did not use a vector however, but it seems my lines tend to be aligned on a plane. I could post my code here if anyone is interested. I don't think I succesfully made a vector field but I can't really inspect it properly. I think what I made is layers of 2D vector (well they aren't vectors but lines) fields. You also need to download the peasycam library to rotate around. I don't know why I'm writing all this considering nobody cares.
@bevkcan
@bevkcan 8 жыл бұрын
DUDE I MADE IT! It's so damn SATISFYING to see 3d vectors wander over time! I mapped every vector's hue to the perlin noise in its coordinates. It currently lacks particle systems but I think I got this. Not too bad for my first procesing program lol
@bevkcan
@bevkcan 8 жыл бұрын
Carlos Valencia I uploaded a short clip on my channel come take a look
@Shockszzbyyous
@Shockszzbyyous 8 жыл бұрын
Your awesome
@nicolasgaritagoitia5536
@nicolasgaritagoitia5536 3 жыл бұрын
why do the points disappear over time? I'm at 25:07 of the the video
Coding Challenge #136.1: Polar Perlin Noise Loops
22:02
The Coding Train
Рет қаралды 196 М.
Coding Challenge #59: Steering Behaviors
30:56
The Coding Train
Рет қаралды 188 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
The Beauty of Code: Flow Fields
7:17
Chris Courses
Рет қаралды 154 М.
Collisions Without a Physics Library! (Coding Challenge 184)
31:05
The Coding Train
Рет қаралды 135 М.
Coding Challenge 171: Wave Function Collapse
1:18:37
The Coding Train
Рет қаралды 563 М.
Coding Challenge 180: Falling Sand
23:00
The Coding Train
Рет қаралды 1,1 МЛН
Coding Challenge 168: MandelBulb 3D Fractal
28:02
The Coding Train
Рет қаралды 378 М.
Coding Challenge 166: ASCII Text Images
22:42
The Coding Train
Рет қаралды 1,1 МЛН
Coding Challenge #136.2: Perlin Noise GIF Loops
26:25
The Coding Train
Рет қаралды 85 М.
Easy Perlin Noise Flow Fields
10:22
Barney Codes
Рет қаралды 36 М.
Coding Challenge #86: Cube Wave by Bees and Bombs
30:09
The Coding Train
Рет қаралды 631 М.