forked from voxel/voxeljs-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
398 lines (347 loc) · 23.7 KB
/
index.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>voxel.js * blocks in yo browser</title>
<meta name="description" content="javascript multiplayer voxel engine">
<meta name="viewport" content="width=device-width">
<link rel"shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
</head>
<body>
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<div id="wrapper">
<article id="intro">
<header>
<img class="logo" src="logo.png"/>
<h3>an open source voxel game building toolkit for modern web browsers</h3>
<ul class="top-nav">
<li><a href="#what">About</a></li>
<li><a href="#gallery">Examples</a></li>
<li><a href="#modules">Modules</a></li>
<li><a href="#how">How</a></li>
<li>
<a href="https://twitter.com/voxeljs" class="twitter-follow-button" data-show-count="false" data-dnt="true" target="_blank">Follow @voxeljs</a>
</li>
<li>
#voxel.js on freenode
</li>
</ul>
<nav class="next-prev">
<a class="next what" href="#what">↓</a>
</nav>
</header>
</article>
<article id="what">
<img src="awesome2.gif" width="350px">
<h2><a name="what" class="anchor" href="#what"><span class="mini-icon mini-icon-link"></span></a>About</h2>
<p>voxel.js is a collection of projects that make it easier than ever to
create 3D voxel games like Minecraft all in the browser.</p>
<p>It was written by <a href="http://twitter.com/maxogden">@maxogden</a> and <a href="http://twitter.com/substack">@substack</a>, two non-game developers that want to make voxel games easy, fun and modular. If you find bugs it is because we don't really know what we are doing. The good news is that 100% of the code is on Github so we hope you will fork it.</p>
</article>
<article id="gallery">
<h2><a name="gallery" class="anchor" href="#gallery"><span class="mini-icon mini-icon-link"></span></a>Examples</h2>
<p>voxel.js games require a computer that can run WebGL, the HTML5 3D graphics
engine. Visit <a href="http://get.webgl.org/">get.webgl.org</a> to see if your
current browser supports it. Chrome version 23 or above or Firefox version
17 or above are recommended.</p>
<p>Click on the screenshots below to run the demos in your browser:</p>
<div id="imgWrapper">
<div class="exampleItem">
<a href="http://maxogden.github.com/voxel-engine/" target="_blank"><img src="demos/1.png"></a>
<cite><a href="https://github.com/maxogden/voxel-hello-world/blob/master/index.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://substack.net/projects/voxel-forest/" target="_blank"><img src="demos/2.png"></a>
<cite><a href="https://github.com/substack/voxel-forest/blob/master/example/forest.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://substack.net/projects/voxel-creature/" target="_blank"><img src="demos/3.png"></a>
<cite><a href="https://github.com/substack/voxel-creature/blob/master/example/debris.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://maxogden.github.com/voxel-perlin-terrain/" target="_blank"><img src="demos/4.png"></a>
<cite><a href="https://github.com/maxogden/voxel-perlin-terrain/blob/master/demo.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://substack.net/projects/radial-voxel-terrain" target="_blank"><img src="demos/5.png"></a>
</div>
<div class="exampleItem">
<a href="http://maxogden.github.com/voxel-simplex-terrain/?seed=typearandomsentencehere!" target="_blank"><img src="demos/6.png"></a>
<cite><a href="https://github.com/maxogden/voxel-simplex-terrain/blob/master/demo.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://maxogden.github.com/voxel-world-function/" target="_blank"><img src="demos/7.png"></a>
<cite><a href="https://github.com/maxogden/voxel-world-function/blob/master/demo.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://shama.github.com/voxel-drone/" target="_blank"><img src="demos/8.png"></a>
<cite><a href="https://github.com/shama/voxel-drone/blob/master/example/world.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://substack.net/projects/voxel-portal/" target="_blank"><img src="demos/9.png"></a>
<cite><a href="https://github.com/substack/voxel-portal/blob/master/example/world.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://shama.github.com/voxel-sky/" target="_blank"><img src="demos/10.png"></a>
<cite><a href="https://github.com/shama/voxel-sky/blob/master/example/world.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://maxogden.github.com/voxel-script-gun/" target="_blank"><img src="demos/11.png"></a>
<cite><a href="https://github.com/maxogden/voxel-script-gun/blob/master/demo.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://maxogden.github.com/voxel-painter/" target="_blank"><img src="demos/12.png"></a>
<cite><a href="https://github.com/maxogden/voxel-painter/blob/master/index.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://hughsk.github.com/voxel-pp/" target="_blank"><img src="demos/13.png"></a>
<cite><a href="https://github.com/hughsk/voxel-pp/blob/master/demo.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://didact.us/spatial-events/" target="_blank"><img src="demos/14.png"></a>
<cite><a href="https://github.com/chrisdickinson/spatial-events/blob/gh-pages/index.js#L75-L79" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://robbles.github.com/voxel-rescue/" target="_blank"><img src="demos/15.png"></a>
<cite><a href="https://github.com/robbles/voxel-rescue/blob/master/demo.js" target="_blank">view source on github</a></cite>
</div>
<div class="exampleItem">
<a href="http://troffmo5.github.com/voxel-oculus/" target="_blank"><img src="demos/16.png"></a>
<cite><a href="https://github.com/troffmo5/voxel-oculus/blob/master/demo.js" target="_blank">view source on github</a></cite>
</div>
</div>
</article>
<article id="modules">
<h2><a name="modules" class="anchor" href="#modules"><span class="mini-icon mini-icon-link"></span></a>Components</h2>
<p>Instead of making a giant game framework we instead decided to split voxel.js
up into a bunch of small building blocks (modules). Modules can be installed
with <a href="http://npmjs.org">npm</a>, the package manager from <a href="http://nodejs.org">node.js</a>.
Here are some modules that we have already started working on:</p>
<h3>The Essentials</h3>
<ul class="essentials">
<li class="itemTitle"><a href="https://github.com/maxogden/voxel-engine">voxel-engine</a>
<li class="itemDesc">this is the main module for building voxel games - you can plug any voxel module into the engine.</li></li>
<li class="itemTitle"><a href="https://github.com/maxogden/voxel">voxel</a>
<li class="itemDesc">the logic that generates voxel world data and compresses voxel data so that it can be
efficiently rendered in 3D. voxel-engine uses this.</li></li>
<li class="itemTitle"><a href="https://github.com/maxogden/voxel-mesh">voxel-mesh</a>
<li class="itemDesc">takes voxel data from the <code>voxel</code> module and turns it into a three.js
3D Mesh that can be displayed in a game. voxel-engine also uses this.</li></li>
</ul>
<img class="essentials-image" src="wireframe-edit.gif">
<h3>Add-ons</h3>
<div class="addons">
<div class="item" style="background-image: url(thumbs/creatures.png);">
<a class="itemTitle" href="https://github.com/substack/voxel-creature">voxel-creature</a>
<div class="itemDesc">lets you add some NPC creatures to your game</div>
</div>
<div class="item" style="background-image: url(thumbs/debris.png);">
<a class="itemTitle" href="https://github.com/substack/voxel-debris">voxel-debris</a>
<div class="itemDesc">configure how much debris appears (and debris physics) when you destroy a block</div>
</div>
<div class="item" style="background-image: url(thumbs/forest.png);">
<a class="itemTitle" href="https://github.com/substack/voxel-forest">voxel-forest</a>
<div class="itemDesc">decorate your world with procedurally generated trees</div>
</div>
<div class="item" style="background-image: url(thumbs/perlin.png);">
<a class="itemTitle" href="https://github.com/maxogden/voxel-perlin-terrain">voxel-perlin-terrain</a>
<div class="itemDesc">generate voxel worlds using perlin noise</div>
</div>
<div class="item" style="background-image: url(thumbs/simplex.png);">
<a class="itemTitle" href="https://github.com/maxogden/voxel-simplex-terrain">voxel-simplex-terrain</a>
<div class="itemDesc">generate voxel worlds using simplex noise (like perlin noise but newer)</div>
</div>
<div class="item" style="background-image: url(thumbs/interact.png);">
<a class="itemTitle" href="https://github.com/chrisdickinson/interact">interact</a>
<div class="itemDesc">a module that makes it easy to get <a href="https://developer.mozilla.org/en-US/docs/API/Pointer_Lock_API">pointer lock</a> in browsers</div>
</div>
<div class="item" style="background-image: url(thumbs/physics.png);">
<a class="itemTitle" href="https://github.com/maxogden/player-physics">player-physics</a>
<div class="itemDesc">the velocity and gravity algorithms for players</div>
</div>
<div class="item" style="background-image: url(thumbs/toolbar.png);">
<a class="itemTitle" href="https://github.com/maxogden/toolbar">toolbar</a>
<div class="itemDesc">- add a customizable toolbar that lets players select items</div>
</div>
<div class="item" style="background-image: url(thumbs/skin.png);">
<a class="itemTitle" href="https://github.com/maxogden/minecraft-skin">minecraft-skin</a>
<div class="itemDesc">load minecraft skins in as three.js mesh objects</div>
</div>
<div class="item" style="background-image: url(thumbs/drone.png);">
<a class="itemTitle" href="https://github.com/shama/voxel-drone">voxel-drone</a>
<div class="itemDesc">script a virtual <a href="http://nodecopter.com">nodecopter</a> inside voxel games!</div>
</div>
<div class="item" style="background-image: url(thumbs/texture.png);">
<a class="itemTitle" href="https://github.com/shama/voxel-texture">voxel-texture</a>
<div class="itemDesc">easily load custom textures into voxel games</div>
</div>
<div class="item" style="background-image: url(thumbs/move.png);">
<a class="itemTitle" href="https://github.com/shama/voxel-move">voxel-move</a>
<div class="itemDesc">rotation relative based movement for 3d objects (used in voxel-drone)</div>
</div>
<div class="item" style="background-image: url(thumbs/portal.png);">
<a class="itemTitle" href="https://github.com/substack/voxel-portal">voxel-portal</a>
<div class="itemDesc">create teleport portals textured with the camera view at the destination</div>
</div>
<div class="item" style="background-image: url(thumbs/storage.png);">
<a class="itemTitle" href="https://github.com/englercj/voxel-storage">voxel-storage</a>
<div class="itemDesc">save and load voxel games with HTML5 IndexedDB. work in progress</div>
</div>
<div class="item" style="background-image: url(thumbs/audio.png);">
<a class="itemTitle" href="https://github.com/ryanramage/voxel-audio">voxel-audio</a>
<div class="itemDesc">positional audio for objects in voxel games using the HTML5 Web Audio API</div>
</div>
<div class="item" style="background-image: url(thumbs/painterly.png);">
<a class="itemTitle" href="https://github.com/dariusk/painterly-textures">painterly-textures</a>
<div class="itemDesc">a module you can install to get the <a href="http://painterlypack.net/">painterly pack</a> block textures</div>
</div>
<div class="item" style="background-image: url(thumbs/highlight.png);">
<a class="itemTitle" href="https://github.com/maxogden/voxel-highlight">voxel-highlight</a>
<div class="itemDesc">highlight or manipulate with the voxel that the player is currently looking at</div>
</div>
<div class="item" style="background-image: url(thumbs/throw.png);">
<a class="itemTitle" href="https://github.com/shama/voxel-throw">voxel-throw</a>
<div class="itemDesc">pick up and throw voxels</div>
</div>
<div class="item" style="background-image: url(thumbs/trajectory.png);">
<a class="itemTitle" href="https://github.com/shama/voxel-trajectory">voxel-trajectory</a>
<div class="itemDesc">calculate trajectories for objects. used in voxel-throw</div>
</div>
<div class="item" style="background-image: url(thumbs/portalgun.png);">
<a class="itemTitle" href="https://github.com/shama/voxel-portal-gun">voxel-portal-gun</a>
<div class="itemDesc">an early version of a portal gun using voxel-portal</div>
</div>
<div class="item" style="background-image: url(thumbs/heightmap.png);">
<a class="itemTitle" href="https://github.com/incompl/voxel-heightmap-terrain">voxel-heightmap-terrain</a>
<div class="itemDesc">generate terrain using a png heightmap</div>
</div>
<div class="item" style="background-image: url(thumbs/pp.png);">
<a class="itemTitle" href="https://github.com/hughsk/voxel-pp">voxel-pp</a>
<div class="itemDesc">voxel post processor. this is a wrapper for <a href="https://github.com/alteredq">@alteredq</a>'s THREE.EffectComposer, which allows you to stack fragment shaders for nice effects such as bloom, vlur, mosaic filters and so on</div>
</div>
<div class="item" style="background-image: url(thumbs/aabb3d.png);">
<a class="itemTitle" href="https://github.com/chrisdickinson/aabb-3d">aabb-3d</a>
<div class="itemDesc"><a href="http://en.wikipedia.org/wiki/Bounding_volume">axis aligned bounding boxes</a>. useful for building something that you intend to collide with the world or other objects</div>
</div>
<div class="item" style="background-image: url(thumbs/spatial-events.png);">
<a class="itemTitle" href="https://github.com/chrisdickinson/spatial-events">spatial-events</a>
<div class="itemDesc">a spatially-aware event emitter, designed to work in 3d space with aabb-3d</div>
</div>
<div class="item" style="background-image: url(thumbs/spatial-trigger.png);">
<a class="itemTitle" href="https://github.com/chrisdickinson/spatial-trigger">spatial-trigger</a>
<div class="itemDesc">given a spatial event emitter (with spatial-events) and an axis aligned bounding box (with aabb-3d), creates a new event emitter that emits enter and exit events when spatial events indicate that something has passed into the bounding box</div>
</div>
<div class="item" style="background-image: url(thumbs/rescue.png);">
<a class="itemTitle" href="https://github.com/robbles/voxel-rescue">voxel-rescue</a>
<div class="itemDesc">automatically teleports the player back to a known location if they enter a certain region of the world (e.g. fall off the map)</div>
</div>
<div class="item" style="background-image: url(thumbs/oculus.png);">
<a class="itemTitle" href="https://github.com/troffmo5/voxel-oculus">voxel-oculus</a>
<div class="itemDesc">3D side by side rendering to be used with the Oculus Rift</div>
</div>
</div>
<p>The goal for all of these modules is that they are <strong>fun, simple and easy to hack</strong>.</p>
</article>
<article id="utilities">
<h2><a name="utilities" class="anchor" href="#utilities"><span class="mini-icon mini-icon-link"></span></a>Tools & Utilities</h2>
<div class="item" style="background-image: url(thumbs/painter.png);">
<a class="itemTitle" href="https://github.com/maxogden/voxel-painter">voxel-painter</a>
<div class="itemDesc">voxel object/creature editor. (doesn't actually depend on any voxel.js modules)</div>
</div>
<div class="item" style="background-image: url(thumbs/vagrant.png);">
<a class="itemTitle" href="https://github.com/datamineruk/voxeljs-vagrant">voxel-vagrant</a>
<div class="itemDesc">a <a href="http://www.vagrantup.com/">Vagrant VM</a> for building voxel games</div>
</div>
<div class="item" style="background-image: url(thumbs/server.png);">
<a class="itemTitle" href="https://github.com/maxogden/voxel-server">voxel-server</a>
<div class="itemDesc">multiplayer voxel games! note: this is still a work in progress and isn't a smooth
as it should be yet</div>
</div>
<div class="item" style="background-image: url(thumbs/minershoes.png);">
<a class="itemTitle" href="http://www.minershoes.com/">minershoes</a>
<div class="itemDesc">make your own minecraft skin. made for minecraft but works with the minecraft-skin module</div>
</div>
</article>
<article id="how">
<h2><a name="how" class="anchor" href="#how"><span class="mini-icon mini-icon-link"></span></a>Making a simple game</h2>
<p>To use the voxel.js modules you will need to install <a href="http://nodejs.org">node.js</a> (which
will also install npm) and be able to use your computer's command line.</p>
<p>Once node.js is installed, you can install the basic voxel.js npm package in your project directory, and then install a basic texture pack:</p>
<pre class="highlight">
<code>
$ npm install voxel-engine
$ npm install painterly-textures
</code>
</pre>
<p>Next, create <em>mygame.js</em> and put the following code in it:</p>
<pre class="highlight">
<code>
var createGame = require('voxel-engine')
var texturePath = require('painterly-textures')
var game = createGame({texturePath: texturePath})
var container = document.body
game.appendTo(container)
container.addEventListener('click', function() {
game.requestPointerLock(container)
})
</code>
</pre>
<p>Then to build your game you use <a href="http://browserify.org">browserify</a>:</p>
<pre class="highlight">
<code>
$ browserify mygame.js > builtgame.js</code>
</pre>
<p>Load builtgame.js into a web page and you're off and running! Look at one of the working examples to learn more.</p>
<p>There are also API docs in the <a href="https://github.com/maxogden/voxel-engine#api">voxel-engine readme</a></p>
<p>If you make a voxel.js module and want it featured on the site you can <a href="https://github.com/maxogden/voxeljs.com">fork the source</a> and add your module to the list.</p>
<h3>Ideas/wishlist</h3>
<p>If any of these look fun to you please help an existing module out by
making it better or start a new module that provides a solution -- whichever
is easier.</p>
<ul class="list">
<li>any performance improvements at all are always welcome</li>
<li>data voxelizers (e.g. <a href="http://www.cs.princeton.edu/~min/binvox/">binvox</a>) for various formats: .stl, .obj,
shapefiles, topojson, CSVs or anything else you can think of!</li>
<li>load minecraft worlds (or portions of them)</li>
<li>in game UI. along the same lines as the <a href="http://github.com/maxogden/toolbar">toolbar</a> module
-- things to make game makers make games that are easier to use</li>
<li>arms for first person players. right now they don't have arms. it is sad</li>
<li>a camera mode that lets you fly around <a href="http://mrdoob.github.com/three.js/examples/webgl_geometry_minecraft.html">like this</a></li>
</ul>
</article>
<article id="more">
<h2>More!</h2>
<p>The <a href="http://0fps.wordpress.com/2012/07/07/meshing-minecraft-part-2/" target="_blank">0fps blog posts on voxel meshing</a> by <a href="https://github.com/mikolalysenko/" target="_blank">@mikolalysenko</a> are the reason voxel.js exists. Highly recommended reading! Definitely check out the <a href="http://mikolalysenko.github.com/MinecraftMeshes2/" target="_blank">meshing toolbox</a>.</p>
<p>mr. doob and <a href="http://threejs.org">three.js</a> are what voxel.js is built on top of.</p>
<p><a href="https://github.com/mitsuhiko/webgl-meincraft">webgl-meincraft</a> is a great tech demo that showed a lot of this can be done in a browser</p>
<p><a href="https://twitter.com/29a_ch">Jonas Wagner</a> made a <a href="http://29a.ch/sandbox/2012/voxelworld/">killer demo</a> and gave <a href="https://github.com/jwagner/voxelworlds/">a great talk</a> about Voxel Worlds on the web that helped to inspire this project.</p>
</article>
<article id="fanart">
<h2>Fan Art</h2>
<p>Here are some of the wonderful things users have made with their voxel worlds. Tweet <a href="http://www.twitter.com/voxeljs" target="_blank">@voxeljs</a> or email max@maxogden.com your photo to submit your art!</a></p>
<div id="artWrapper">
<img src="postcard-forest.png">
<cite>by <a href="http://www.twitter.com/jllord" target="_blank">@jllord</a></cite>
</div>
</article>
<footer>Any other thoughts or questions, seek out <a href="http://www.twitter.com/maxogden" target="_blank">@maxogden</a> and <a href="http://www.twitter.com/substack" target="_blank">@substack</a>. Site by fan <a href="http://www.twitter.com/jllord" target="_blank">@jllord</a>. Meow.</footer>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-37591690-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>