mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v. 0.60.04b
This commit is contained in:
parent
cf4ae9e177
commit
1b818bc855
1 changed files with 3 additions and 4 deletions
|
|
@ -76,7 +76,7 @@ function fantasyMap() {
|
||||||
oceanLayers.append("rect").attr("id", "oceanBase");
|
oceanLayers.append("rect").attr("id", "oceanBase");
|
||||||
|
|
||||||
// main data variables
|
// main data variables
|
||||||
var seed, params, voronoi, diagram, polygons, points = [],heights;
|
var seed, params, voronoi, diagram, polygons, spacing, points = [], heights;
|
||||||
// Common variables
|
// Common variables
|
||||||
var modules = {}, customization = 0, history = [], historyStage = 0, elSelected, autoResize = true, graphSize,
|
var modules = {}, customization = 0, history = [], historyStage = 0, elSelected, autoResize = true, graphSize,
|
||||||
cells = [],land = [], riversData = [], manors = [], states = [], features = [], notes = [],
|
cells = [],land = [], riversData = [], manors = [], states = [], features = [], notes = [],
|
||||||
|
|
@ -108,9 +108,6 @@ function fantasyMap() {
|
||||||
let graphHeight = +mapHeightInput.value;
|
let graphHeight = +mapHeightInput.value;
|
||||||
let svgWidth = graphWidth, svgHeight = graphHeight; // svg canvas resolution, can vary for each map
|
let svgWidth = graphWidth, svgHeight = graphHeight; // svg canvas resolution, can vary for each map
|
||||||
|
|
||||||
let sizeMod = rn((graphWidth + graphHeight) / 1500, 2); // screen size modifier
|
|
||||||
let spacing = rn(7.5 * sizeMod / graphSize, 2); // space between points before jirrering
|
|
||||||
|
|
||||||
// toggle off loading screen and on menus
|
// toggle off loading screen and on menus
|
||||||
$("#loading, #initial").remove();
|
$("#loading, #initial").remove();
|
||||||
svg.style("background-color", "#000000");
|
svg.style("background-color", "#000000");
|
||||||
|
|
@ -6991,6 +6988,8 @@ function fantasyMap() {
|
||||||
|
|
||||||
// get square grid with some jirrering
|
// get square grid with some jirrering
|
||||||
function getJitteredGrid() {
|
function getJitteredGrid() {
|
||||||
|
let sizeMod = rn((graphWidth + graphHeight) / 1500, 2); // screen size modifier
|
||||||
|
let spacing = rn(7.5 * sizeMod / graphSize, 2); // space between points before jirrering
|
||||||
const radius = spacing / 2; // square radius
|
const radius = spacing / 2; // square radius
|
||||||
const jittering = radius * 0.9; // max deviation
|
const jittering = radius * 0.9; // max deviation
|
||||||
const jitter = function() {return Math.random() * 2 * jittering - jittering;}
|
const jitter = function() {return Math.random() * 2 * jittering - jittering;}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue