Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Marching Squares - basic code based on MS algorithm

Author
Message
TheWanted
1
Years of Service
User Offline
Joined: 17th Oct 2023
Location:
Posted: 12th Oct 2024 09:36 Edited at: 23rd Oct 2024 11:17
Here is some code based on tutorial provided by TheCodingTrain on YT/Github. So main credits go to him.
IanM Matrix1Utils required for some of the examples.

More work to do and experiment with.

TheWanted
1
Years of Service
User Offline
Joined: 17th Oct 2023
Location:
Posted: 15th Oct 2024 21:36 Edited at: 15th Oct 2024 21:52
The code below, uses Marching Squares algorithm using Lerp / Noise.
link to the Noise plugin here https://forum.thegamecreators.com/thread/189861

Try changing various values eg. rez = 0.5

TheWanted
1
Years of Service
User Offline
Joined: 17th Oct 2023
Location:
Posted: 21st Oct 2024 08:26 Edited at: 21st Oct 2024 15:48
Main credits go to Sebastian Lague.

Procedural Cave Generation:

Play around with values e.g. randomFillPercent .
Update #1: drawing process sped up.
Update #2: camera control, press left mouse button to generate new map.
Update #3: detects if mouse already clicked if held down.

More to come.

TheWanted
1
Years of Service
User Offline
Joined: 17th Oct 2023
Location:
Posted: 23rd Oct 2024 11:15
Metaballs source code using Marching Squares algorithm.

Hannibal
17
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 25th Oct 2024 10:46
Personally I can't compile any of these... :-(
TheWanted
1
Years of Service
User Offline
Joined: 17th Oct 2023
Location:
Posted: 6th Nov 2024 17:18 Edited at: 6th Nov 2024 17:19
the first example doesn't use any 3rd party plugins so should compile. Noise plugin is required for the noise example as mentioned above and also you will need IanM MatrixUtils1.
3D code to come soon for Marching Cubes.

Login to post a reply

Server time is: 2024-11-17 22:39:47
Your offset time is: 2024-11-17 22:39:47