Coding Train Live 37: 3D Terrain Generation

  Рет қаралды 40,985

The Coding Train

The Coding Train

Күн бұрын

Live from sfpc.io!
In this video, I create a 3D moving terrain using Perlin Noise and the beginShape() function in Processing.
💻 thecodingtrain...
Timestamps:
28:55 - Coding Challenge: 3D Terrain Generator
51:40 - Conclusion
🚂 Website: thecodingtrain....
👾 Share Your Creation! thecodingtrain...
🚩 Suggest Topics: github.com/Cod...
💡 GitHub: github.com/Cod...
💬 Discord: thecodingtrain...
💖 Membership: kzbin.info...
🛒 Store: standard.tv/co...
🖋️ 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
Links discussed in this video:
Nature of Code class on Kadenze: www.kadenze.co...
My Perlin Noise video: • I.5: Perlin Noise - Th...
beginShape() reference: processing.org...
noise() reference: processing.org...
Help us caption & translate this video!
📄 Code of Conduct: github.com/Cod...

Пікірлер: 49
@davidhuynh2560
@davidhuynh2560 8 жыл бұрын
Coding from scratch begins at 28:55
@nofacee94
@nofacee94 7 жыл бұрын
thanks, this is helpful in JavaScript.
@MisterMajister
@MisterMajister 7 жыл бұрын
Hey Daniel, long since you uploaded this, but loved the video! I removed the stroke added lights and filled with a lush green. Then I added a blue plane (4 closed vertices) with z-coordinates slightly above the lower mapping limit to produce lakes. It looks neat ;)
@pearyd1204
@pearyd1204 8 жыл бұрын
Or even 3D perlin noise caves would be simple but cool
@JohnJ-xm3fg
@JohnJ-xm3fg 7 жыл бұрын
+Daniel Shiffman Is there P3D (or similar) in p5js?
@arnaldoquinones7764
@arnaldoquinones7764 8 ай бұрын
Can someone tell what programing lenguaje uses for coding? Thanks!
@cookieaceae1413
@cookieaceae1413 2 жыл бұрын
Hey man, big fan. Love your video. I was always confused about using Perlin Noise but your video was so clear and easy to understand. Keep up the good work!
@iAzazelHD
@iAzazelHD 7 жыл бұрын
Could u make a video painting the terrain according the the value terrain [x][y] gets pls?
@dantecollet768
@dantecollet768 7 жыл бұрын
Make this please in Javascript
@beyondlwm
@beyondlwm 2 жыл бұрын
Like your video but why the subtiles are closed?
@thommiano9519
@thommiano9519 8 жыл бұрын
I've found your materials to be rich yet very accessible. Thanks so much!
@KamelOfficial
@KamelOfficial 8 жыл бұрын
could it be that the frameRate() bug at 39:00 is happening because you are writing it in the draw() function and not in the setup()? anyhow, thank you a lot for all the videos. i just started learning processing, and you and your books are my holy bible!
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+FrancescoCameli aha, you are right! It doesn't work to change the frameRate in draw() for P3D. Thanks for the nice feedback!
@ibgi1995
@ibgi1995 7 жыл бұрын
skip to 28:00 id you want to see from beginning of the build
@gamehelp16
@gamehelp16 8 жыл бұрын
On the first part of the video before the coding challenge how do you make it so that some triangles are darker than the others creating a "bumpy" effect?
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+gamehelp16 You can use fill() to color each triangle individually. You could try mapping the z-value to the fill brightness.
@gamehelp16
@gamehelp16 8 жыл бұрын
+Daniel Shiffman I have tried that but what I got is a "smooth" coloring, while in the video it's just some parts which get colored and some are not.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+gamehelp16 What you are seeing I think is that the triangles have an alpha so when they are near each other the overlapping color gets darker. I'm actually using the same fill() for all of them.
@gamehelp16
@gamehelp16 8 жыл бұрын
+Daniel Shiffman ah, okay!
@gnkarn00
@gnkarn00 5 жыл бұрын
can add fill(120, 222, 120, terrain[x][y + 1] + 105); at the end of the vertex loop, so the mesh will result being "coloured " , kind of better look .
@rallymax2
@rallymax2 Жыл бұрын
From chaos to solid 22min tutorial. You are da man. You make it look easy, your experience shows.
@thomasroyez
@thomasroyez 5 жыл бұрын
Yup very good lesson thank you, I am back to processing after years, and discover some news great functions. Playing with this code, I don't understand why I can't export an SVG. file from this code, using the SVG import function, that actually works good on others programs I wrote. Can someone help me ?
@programmer1up286
@programmer1up286 7 жыл бұрын
What about terrain on a sphere?
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
oh, love this idea! Take a look at my sphere video for more: kzbin.info/www/bejne/iJzYc4p7oKelkKM
@programmer1up286
@programmer1up286 7 жыл бұрын
Thank you so much for responding!! Perhaps you could record a tutorial featuring terrain on a sphere or planetary terrain? :D
@TheSpectron3
@TheSpectron3 8 жыл бұрын
That was a good live, although it France it started at 10pm, which is prety late :D btw, I started making a series of challenges where I talked about you :)
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+Spectron Cool, please share links!
@codemix129
@codemix129 7 жыл бұрын
Please show us a project with the Hype framework!
@toastyPredicament
@toastyPredicament 2 жыл бұрын
Nyaaaaaaaa
@obedotto4465
@obedotto4465 2 жыл бұрын
you should add orbit controls :D
@Ghanzo
@Ghanzo 7 жыл бұрын
Is he using a server to test his results?
@smootheddrake5481
@smootheddrake5481 5 жыл бұрын
42:59 man, he lasted longer than i thought
@Jimanator
@Jimanator 8 жыл бұрын
another way to give a smoothing effect wold be to add a random slope to the previous value.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+James Butler (Jim) Thanks for the tip!
@Ghanzo
@Ghanzo 7 жыл бұрын
Wow that was fast, well done!
@HundredsScope
@HundredsScope 8 жыл бұрын
very nice tutorial :)
@pearyd1204
@pearyd1204 8 жыл бұрын
Could we maybe get a part 2 with more advanced noise? Like more mountainous terrain with more rough detail in he terrain instead of regular old smooth 2d noise, I've done this prior to your video and use 2d perlin noise arrays a lot in my projects so a bit more advanced procedural terrain would be cool and quite helpful, great video keep them up!
@pearyd1204
@pearyd1204 8 жыл бұрын
Btw I ment mountainous in the way how regular 2d perlin noise only looks hilly, with smooth peaks, not large mountains with sharper peaks which would be cooler
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+Peary D interesting, great suggestions, I will keep this in mind!
@chimichangle
@chimichangle 8 жыл бұрын
I have no clue how to translate this into p5.js, my biggest problem being the lack of 2D arrays in javascript. Are there any resources you know that might help?
@nofacee94
@nofacee94 7 жыл бұрын
2d arrays are simple in JavaScript = [[0,1,2,3],["a","b","c","d"]] is a 2D array; 2 arrays inside a single array.
@chimichangle
@chimichangle 7 жыл бұрын
Noface are the arrays inside the arrays flexible in length like normal arrays?
@nofacee94
@nofacee94 7 жыл бұрын
Yes but be careful when you iterate over them inside for loops. If you use something like: my2DArray = [ ["A","B","C"],["D","E"] ]; You can see the first array (A,B,C) contains 3 values, while the second array contains only 2. The length of any array is retrieved using .length e.g. my2DArray.length First you loop over the entire array (for all values in the array) -> for (i=0;i
@EeVennSoh
@EeVennSoh 7 жыл бұрын
Is there a p5.js example of this?
@TheCodingTrain
@TheCodingTrain 7 жыл бұрын
yes, check the rainbow-code repo!
@fallenmoon483
@fallenmoon483 3 жыл бұрын
Awesome!
@lumstell
@lumstell 8 жыл бұрын
thanks
@katrix422
@katrix422 8 жыл бұрын
lovely
@eotikurac
@eotikurac 8 жыл бұрын
you need to start saying "daaaamn daniel" when you brake something that worked
I.5: Perlin Noise - The Nature of Code
13:44
The Coding Train
Рет қаралды 187 М.
Coding Challenge 11: 3D Terrain Generation with Perlin Noise in Processing
22:44
Крутой фокус + секрет! #shorts
00:10
Роман Magic
Рет қаралды 21 МЛН
Ozoda - Lada (Official Music Video)
06:07
Ozoda
Рет қаралды 14 МЛН
Как мы играем в игры 😂
00:20
МЯТНАЯ ФАНТА
Рет қаралды 3,2 МЛН
Coding Challenge 180: Falling Sand
23:00
The Coding Train
Рет қаралды 938 М.
What's The Longest Word You Can Write With Seven-Segment Displays?
8:56
Processing 3D: Using OBJ Files
5:47
J. Stephen Lee
Рет қаралды 4,9 М.
Coding Challenge: 3D on Apple II
45:40
The Coding Train
Рет қаралды 328 М.
Coding Challenge 166: ASCII Text Images
22:42
The Coding Train
Рет қаралды 1,1 МЛН
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 82 М.
C++: Perlin Noise Tutorial
8:52
Zipped
Рет қаралды 13 М.
Coding Challenge #47: Pixel Sorting in Processing
20:31
The Coding Train
Рет қаралды 200 М.
Just enough assembly to blow your mind
29:31
Kay Lack
Рет қаралды 73 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 811 М.