View main.js
var regl = require('regl')()
var camera = require('regl-camera')(regl,
{ distance: 32, theta: 1.6, phi: 0.2 })
var sphere = require('icosphere')(5)
var glsl = require('glslify')
var anormals = require('angle-normals')
var mat4 = require('gl-mat4')
var feedback = require('regl-feedback')
var fbtex = regl.texture()
View main.js
var regl = require('regl')()
var camera = require('regl-camera')(regl, {
distance: 15, phi: 0.2 })
var conway = require('conway-hart')
var glsl = require('glslify')
var grid = require('grid-mesh')
var draw = {
cool: shape(regl,'T'),
good: shape(regl,'I'),
View peermaps-data.md

peermaps data is ready

Peermaps is a project to bring OpenStreetMap data to the p2p web.

I've just finished a big part of this project: subdividing planet-latest.osm.pbf to support ad-hoc extracts. With ad-hoc extracts over p2p networks, you can download only the parts of planet osm that you need without having to download the whole 34G thing and process it using tens of gigabytes of RAM. Using the peermaps data archive, you can build tile sets for the entire planet on very modest hardware. Every .o5m.gz file is at most 1M. More details below.

View drive.js
var namedArchives = require('hyperdrive-named-archives')
var hyperdrive = require('hyperdrive')
var filestore = require('random-access-file')
var sub = require('subleveldown')
var path = require('path')
var DRIVE = 'd', NAMED = 'n'
module.exports = function (db, opts) {
var dir = opts.dir
View archive.js
var namedArchives = require('hyperdrive-named-archives')
var hyperdrive = require('hyperdrive')
var filestore = require('random-access-file')
var path = require('path')
var DRIVE = 'd', NAMED = 'n'
module.exports = function (db, opts) {
var dir = opts.dir
var named = namedArchives({
View main.js
var html = require('yo-yo')
var root = document.body.appendChild(document.createElement('div'))
var state = { n: 0 }
update()
function update () {
html.update(root, html`<div>
<h1>${state.n} clicks</h1>
<div>
<button onclick=${onclick}>click</button>
View vector-globe.md

making a vector globe

when you're done, it should look like this:

install some commands if you don't already have them:

View main.js
{
"scripts": {
"watch": "budo main.js"
},
"browserify": {
"transform": [ "glslify" ]
}
}
View show.js
var level = require('level')
var db = level('log1')
var hyperlog = require('hyperlog')
var log = hyperlog(db, { valueEncoding: 'json' })
var through = require('through2')
var pump = require('pump')
pump(log.createReadStream(), through.obj(write))
function write (row, enc, next) {
View globe.js
var regl = require('regl')()
var camera = require('regl-camera')(regl, {
minDistance: 1, distance: 3 //, phi: -Math.PI/2
})
var mat4 = require('gl-mat4')
var icosphere = require('icosphere')
//var scoords = require('varying-spherical-coordinates')
var glsl = require('glslify')
//var resl = require('resl')