Making noise for terrain of the game ( OpenGL + C++ ) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Making noise for terrain of the game ( OpenGL + C++ )

hi all, I want to make some noise for the terrain of the game. ( like minecraft ) I tried with rand() function but it doesn't look pretty well this is what I have: https://ibb.co/eiv4M6 this is what I want: https://ibb.co/i1Ps8m can someone help?

30th Jan 2018, 3:43 PM
Light
Light - avatar
3 Answers
+ 7
Instead of making each block’s elevation completely random, make a few points random, then the ones in between transition in elevation between them. The more points you make random, the more unordered it will be. Tweak the numbers until you get what you want. Although congratulations for figuring out OpenGL, I’ve been trying for ages some success in understanding but none in remembering.
30th Jan 2018, 3:57 PM
Jacob Pembleton
Jacob Pembleton - avatar
+ 5
Jacob Pembleton, This is my OpenGL learning source: https://learnopengl.com/ it completely explains everything. I think it's useful for you ( if you still want to )
31st Jan 2018, 9:53 AM
Light
Light - avatar
+ 3
@kurwius sorry, but I don't understand this part: extern float Gradient[IYMAX][IXMAX][2]; what I have to assign to it ? and can you give me an example.
31st Jan 2018, 9:44 AM
Light
Light - avatar