A procedural road generator using voxels.
Go to https://rototu.github.io/voxelRoadGenerator/.
(ES6 compatible browser needed)
Use 3dGeomBrowser.js.
Two functions are exported:
-
MapGen.getMap(roadLength, roadLinearity, altitudeVariation)
returning a procedurally generated road as ashapeArray[verticesArray[xyzArray[]]]
. -
MapGen.generateJSONMap(roadLength, roadLinearity, altitudeVariation)
returning same data as above but in JSON format.
Use 3dGeomNode.js.
Same functions as above are exported, plus
MapGen.writeJSONMapsToFiles(noOfMaps, roadLength, roadLinearity, altitudeVariation)
which generates a set amount of random maps of given length.