I revamped a demo similar to Minecraft where you can jump and build blocks. However, the texture of the blocks I create appears smooth instead of pixelated, and I'm not sure why.
Here is the relevant source code snippet:
var textureDirt = THREE.ImageUtils.loadTexture( 'img/dirt.png' );
textureGrass.magFilter = THREE.NearestFilter;
textureGrass.minFilter = THREE.LinearMipMapLinearFilter;
var material = new THREE.MeshLambertMaterial( { map: textureDirt, ambient: 0xbbbbbb, vertexColors: THREE.VertexColors } );
var geometry = new THREE.CubeGeometry(1,1,1);
var mesh = new THREE.Mesh(geometry, material);
mesh.position.x = point[0];
mesh.position.y = point[1];
mesh.position.z = point[2];
// for physics
mesh.blockType = type;
world[point] = mesh;
scene.add(mesh);
Check out the live demo:
For more details on the code: https://github.com/ubershmekel/mine3js/blob/master/js/main.js