A voxel (volumetric pixel or Volumetric Picture Element) is a volume element, representing a value on a regular grid in three dimensional space.
Create an actual voxel game
world.add(new Cube(...));
world.add(new Cube(...));
world.add(new Cube(...));
world.add(new Cube(...));
http://htwins.net/scale2/
// the naive way
for voxel in chunk
if voxel != empty
for side of voxel
triangles.add(side)
// the smarter way
for voxel in chunk
if voxel != empty
for side of voxel
// check sides!
if voxel on that side is empty:
vertices.add(side)
in less than seven days.
Please stand back I'm going to attempt,
https://github.com/jwagner/simplex-noise.js
var random = new Alea(seed),
simplex = new SimplexNoise(random);
voxel.init_world(world, function(x, y, z) {
var density = simplex.noise3D(x/32, y/32, z/32)-y/15;
if(density > -0.75){
return 3;
}
if(density > -0.92){
return 2;
}
if(density > -1.0){
return 1;
}
return 0;
});
function clipSegmentSegment(a0, a1, b0, b1){
// before
if(b1 < a0) {
return a0-b1;
}
if(b0 > a1){
return a1-b0;
}
return 0.0;
}
function clipSegmentPoint(a0, a1, b0){
if(b0 < a0) return a0-b0;
if(b0 > a1) return a1-b0;
return 0.0;
}
var xd = clipSegmentPoint(aabb.x0, aabb.x1, this.x),
yd = clipSegmentSegment(aabb.y0, aabb.y1, this.y0, this.y1),
zd = clipSegmentPoint(aabb.z0, aabb.z1, this.z),
d2 = xd*xd + yd*yd + zd*zd;
if(d2 >= this.radius * this.radius){
return null;
}
var d = Math.sqrt(d2),
penetration = this.radius-d,
resolution = vec3.create([-xd/d*penetration,
-yd/d*penetration,
-zd/d*penetration]),
Commanche http://upload.wikimedia.org/wikipedia/en/4/46/Comanche_1992.png Minerwars http://www.minerwars.com/PicZoom.aspx?id=20 Minecraft UGC: http://videogamecove.blogspot.ch/2012/07/minecraft-review.html http://mc.westeroscraft.com/press.html