mardi 14 août 2018

Diamond-Square algorithm: How do I determine what tiles I need to run a diamond function and what tiles I need to run a square function on?

I'm working on a diamond-square heightmap generator and I've been stuck on a certain part for a while now.

I'm having trouble determining which tiles I need to run a square() function on and which tiles I need to run a diamond() function on.

I took a look at this guide: http://www.playfuljs.com/realistic-terrain-in-130-lines/ and I took their for loop they're using as an example, but it didn't seem to work at all.

The preferred language for the answer is Lua (or just kindly point me in the right direction). I just need someone to tell me what I need to do to get a for loop that works for both diamond and square functions.




Aucun commentaire:

Enregistrer un commentaire