View regl.js
var regl = require('regl')()
var camera = require('regl-camera')(regl, {
distance: 5
})
var bunny = require('bunny')
var mat4 = require('gl-mat4')
var anormals = require('angle-normals')
var draw = { cool: cool(regl) }
regl.frame(function () {
View main.js
var regl = require('regl')()
var fs = require('fs')
var snoise = fs.readFileSync(require.resolve('glsl-noise/simplex/3d.glsl'),'utf8')
var cnoise = fs.readFileSync(require.resolve('glsl-curl-noise/curl.glsl'),'utf8')
var sphereMesh = require('sphere-mesh')
var mat4 = require('gl-mat4')
var camera = require('regl-camera')(regl, {
center: [0,0,0],
distance: 4
})
View users.js
var osmdb = require('osm-p2p-db')
var level = require('level')
var fdstore = require('fd-chunk-store')
var sodium = require('chloride')
var hsodium = require('hyperlog-sodium')
var xtend = require('xtend')
var users = require('osm-p2p-users')({
db: level('/tmp/osm-p2p/users'),
sodium: require('chloride')
View cool.js
var column = require('column-mesh')
var mesh = column()
module.exports = function (regl) {
return regl({
frag: ``,
vert: ``,
//...
})
}
View column.js
var surface = require('isosurface').surfaceNets
var vec3 = require('gl-vec3')
var mat4 = require('gl-mat4')
var length = vec3.length, sub = vec3.subtract
var max = vec3.max, min = vec3.min, dot = vec3.dot
var abs = elwise(Math.abs), sqrt = elwise(Math.sqrt)
function elwise (f) {
return function (out, v) {
View hsl2rgb.glsl
vec3 hsl2rgb(in float h, float s, float l) {
vec3 rgb = clamp( abs(mod(h*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0 );
return l + s * (rgb-0.5)*(1.0-abs(2.0*l-1.0));
}
View index.js
var db = ....
exports.users = function (cb) {
// ...
// at some point, cb(null, users) or cb(err)
}
exports.createUser = require('./create_user.js')
View compile.js
var browserify = require('browserify')
var fs = require('fs')
var concat = require('concat-stream')
var createHash = require('crypto').createHash
var b = browserify('main.js').bundle()
var pending = 2, hash = null
b.pipe(fs.createWriteStream('bundle.js'))
.once('finish', done)
View grid.js
var PI = Math.PI
var sin = Math.sin, asin = Math.asin
module.exports = function compute (opts) {
var nx = opts.xcount
var ny = opts.ycount
var xmin = opts.xmin
var xmax = opts.xmax
var ymin = opts.ymin
var ymax = opts.ymax
View scrub.js
#!/usr/bin/env node
var minimist = require('minimist')
var argv = minimist(process.argv.slice(2), {
alias: { i: 'ignore' },
string: [ 'ignore' ]
})
var to = require('to2')
var ignore = [].concat(argv.ignore)
var osmdb = require('osm-p2p')