SHARE
TWEET

Untitled

a guest Oct 21st, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for(int y = 0; y < HEIGHT; y++) {
  2.     for(int x = 0; x < WIDTH; x++) {
  3.         float fx = (1.0f / (float)WIDTH); // multiply fx, fy
  4.         float fy = (1.0f / (float)HEIGHT); // to scale perlin sampling.
  5.         float height = perlin_2d(fx, fy); // maybe add seed somewhere.
  6.  
  7.         int offset = x + (y * WIDTH);
  8.         verts[offset].x = (float)x;
  9.         verts[offset].y = height;
  10.         verts[offset].z = (float)y;
  11.     }
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top