r/processing • • Oct 06 '19

I made a 3D Island Generator in Processing!

330 Upvotes

18 comments sorted by

15

u/InfernoGems Oct 06 '19

For an explanation watch the complete video, or download the source code:

Video demonstration and explanation on YouTube

Source code on GitHub

21

u/uhrguhrguhrg Oct 06 '19

Really love the stylistic choice and the color scheme.

Some ideas:

  • Make the water plane transparent, so you can see the underwater part of the shore.

  • Generate trees from lines in 3D space, so they look better in motion.

  • Add some rudimentary lighting. You could make it part of the texture by darkening descending slopes on one side.

9

u/InfernoGems Oct 07 '19

Thank you for the kind words and feedback :)

I made the trees 2D images because this was a quick and easy way to make a high performant sketch. I also took inspiration from old games that used sprites instead of 3D models. But in the future I could do that as well :)

I didn't add a directional lighting because I couldn’t get that to work smoothly with the terrain since those are all separate quad strips.

I really like the idea of making the water plane transparant, I would have to look into blend modes but I’m already envisioning coral reefs and swimming fish :)

2

u/uhrguhrguhrg Oct 07 '19

For smooth lighting you'd have to define normals based on neighbouring points using cross vector product.

2

u/InfernoGems Oct 07 '19

Ah that makes sense. Thank you :) I will look into it!

3

u/Goldilocks02 Oct 06 '19

Very nice

1

u/InfernoGems Oct 06 '19

Thank you :)

2

u/phantomFalcon14 Oct 07 '19

Amazing! What did you use to make this? Besides processing?

3

u/InfernoGems Oct 07 '19

This is all processing, the trees, rocks, grass and textures are all being generated in processing using PGraphics drawing surfaces. You can have a look at the code on Github and run it if you like :)

2

u/paloumbo Oct 07 '19

You should switch to unity.

It still coding, quite simple ( csharp isn't too complicate to handle when you come from processing/java, especially with VSCode with the right plugins) and the camera is much easier to handle, with the lights.

4

u/InfernoGems Oct 07 '19

I have worked with Unity and C# before, and I really like using it. However, I had a school assignment for which I had to use Processing. Otherwise I agree that Unity is way better for things like this ;)

4

u/hammedhaaret Oct 06 '19

lovely style!

3

u/Iampepeu Oct 07 '19

Oooooh! This is amazing!

(I have so many saved Processing ideas/posts/snippets/blabla. I really need to take some time to start fiddling with it again. There's so much cool stuff to learn.)

2

u/TheLegendIn52 Oct 07 '19

I like this... really like it!

0

u/[deleted] Oct 07 '19

[deleted]

1

u/InfernoGems Oct 07 '19

Thank you! I’ve never heard of it before but it looks really sweet :)