Search the Community
Showing results for tags 'populous'.
-
Hi everyone. I've been toying around with using perlin and simplex noise to generate height values for a terrain mesh with threejs. My aim is to create something visually similar to Populous. So far I have something that looks like this. At the moment I have custom plane mesh subdivided horizontally and vertically by 10. Each of the mesh's vertices y value is determined by using a noise function. This all works fine enough it seems, though I am running into issues when trying to implement a scrolling effect, again similar to Populous. First I declare and init some variables. //globalvar mesh_width = 10, mesh_height = 10;var tile_width = 1;var xpos = 0, zpos = 0;var x = xpos, z = zpos;//initialize terrain data arrayvar terrain_data = new Array(mesh_height);for(var i = 0; i < terrain_data.length; i++){ terrain_data[i] = new Array(mesh_width);}noise.seed(Math.random());I then define the terrain_data object using the noise functions. for(var j = 0; j < 10; j++){ for(var i = 0; i < 10; i++){ var value = noise.simplex3(x, z, 0); value *= quality; //console.log(Math.abs(noise.simplex2(x, z))); terrain[i][j] = Math.abs(value); x += 1; }z += 1;}EDIT: This was a mis-post. I'm sorry. It can be deleted.