Created
August 22, 2017 13:22
-
-
Save bhouston/b3d8c1c7a5e3fde701527eca801f352a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shuffle = require('shuffle-array'); | |
var PoissonDiskSampling = require('poisson-disk-sampling'); | |
var p = new PoissonDiskSampling([1000, 1000], 100, 100, 10); | |
var points = p.fill(); | |
for( i = 0; i < points.length; i ++ ) { | |
points[i][0] = Math.round( points[i][0] * 100 ) / (1000*100); | |
points[i][1] = Math.round( points[i][1] * 100 ) / (1000*100); | |
} | |
shuffle( points ); | |
shuffle( points ); | |
for( i = 0; i < points.length; i ++ ) { | |
console.log( "poissonDisk[" + i + "] = vec2( " + points[i][0] + ", " + points[i][0] + " );\\n\\" ); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment