Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int y = 0; y < HEIGHT; y++) {
- for(int x = 0; x < WIDTH; x++) {
- float fx = (1.0f / (float)WIDTH); // multiply fx, fy
- float fy = (1.0f / (float)HEIGHT); // to scale perlin sampling.
- float height = perlin_2d(fx, fy); // maybe add seed somewhere.
- int offset = x + (y * WIDTH);
- verts[offset].x = (float)x;
- verts[offset].y = height;
- verts[offset].z = (float)y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement