-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
38 lines (38 loc) · 2.79 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
"name": "voxel",
"description": "tools to work with voxel generation and chunking in javascript",
"version": "0.1.5",
"main": "index.js",
"dependencies": {
"inherits": "1.0.0"
},
"repository": {
"type": "git",
"url": "http://github.com/maxogden/voxel.git"
},
"scripts": {
"test": "node test.js"
},
"author": {
"name": "Max Ogden",
"email": "max@maxogden.com"
},
"license": "MIT",
"engine": {
"node": ">=0.6.0"
},
"devDependencies": {
"microtime": "~0.3.3"
},
"readme": "# voxel\n\nvoxel geometry generation and meshing algorithms in javascript. written by @mikolalysenko and put on npm by me.\n\n- original repo: https://github.com/mikolalysenko/mikolalysenko.github.com/tree/master/MinecraftMeshes2\n- blog post: http://0fps.wordpress.com/2012/07/07/meshing-minecraft-part-2/\n- webgl demo: http://mikolalysenko.github.com/MinecraftMeshes2/\n\n# installation\n\nin node:\n```\nnpm install voxel\n```\nin a browser:\n\nuse `voxel-browser.js`\n\n# usage\n\n## require('voxel').generate(low, high, iterator)\n\nwhere `low` and `high` are `[x, y, z]` start and end positions to iterate over and `iterator` is the function that visits each voxel\n\nreturns an object like this: `{ \"voxels\": \"a 1D Int32Array filled with voxel data\", \"dims\": [x, y, z] }`\n\nexample that creates randomly colored voxels:\n\n```javascript\nrequire('voxel').generate([0,0,0], [16,16,16], function(x,y,z) {\n return Math.round(Math.random() * 0xffffff)\n})\n```\n\na sphere:\n\n```javascript\nrequire('voxel').generate([0,0,0], [32,32,32], function(x,y,z) {\n return x*x+y*y+z*z <= 16*16 ? 0x113344 : 0\n})\n```\n\nusing the included generator functions:\n\n```javascript\nvar voxel = require('voxel')\nvoxel.generate([0,0,0], [32,32,32], voxel.generator['Hilly Terrain'])\n// or\nvoxel.geometry['Hilly Terrain'] // pre-generated at some specific example size\n```\n\n## require('voxel').meshers\n\n`meshers` is an object with `stupid`, `culled`, `monotone` and `greedy` mesher functions. you probably want to just use `greedy`. all mesher functions accept voxel data in the format the gets returned by the `generate` function.\n\n## require('voxel').generator\n\nan object that contains a bunch of voxel generation functions to play with, from http://mikolalysenko.github.com/MinecraftMeshes2/\n\n## require('voxel').generateExamples()\n\nreturns an object that contains a bunch of pre-generated voxel geometries to play with, from http://mikolalysenko.github.com/MinecraftMeshes2/\n\n# license\n\nMIT",
"readmeFilename": "readme.md",
"bugs": {
"url": "https://github.com/maxogden/voxel/issues"
},
"_id": "voxel@0.1.5",
"dist": {
"shasum": "3152bcf272904c34744e4c4592c32dde3f6e4508"
},
"_from": "voxel@~0.1.5",
"_resolved": "https://registry.npmjs.org/voxel/-/voxel-0.1.5.tgz"
}