$(document).ready(function()
      {
      	var camera, scene, renderer;
var geometry, material, mesh;
var controls,time = Date.now();

var objects = [];

var ray;

var blocker = document.getElementById( 'blocker' );
var instructions = document.getElementById( 'instructions' );

// http://www.html5rocks.com/en/tutorials/pointerlock/intro/

var havePointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document;

if ( havePointerLock ) {

var element = document.body;

var pointerlockchange = function ( event ) {

if ( document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element ) {

controls.enabled = true;

blocker.style.display = 'none';

} else {

controls.enabled = false;

blocker.style.display = '-webkit-box';
blocker.style.display = '-moz-box';
blocker.style.display = 'box';

instructions.style.display = '';

}

}

var pointerlockerror = function ( event ) {

instructions.style.display = '';

}

// Hook pointer lock state change events
document.addEventListener( 'pointerlockchange', pointerlockchange, false );
document.addEventListener( 'mozpointerlockchange', pointerlockchange, false );
document.addEventListener( 'webkitpointerlockchange', pointerlockchange, false );

document.addEventListener( 'pointerlockerror', pointerlockerror, false );
document.addEventListener( 'mozpointerlockerror', pointerlockerror, false );
document.addEventListener( 'webkitpointerlockerror', pointerlockerror, false );

instructions.addEventListener( 'click', function ( event ) {

instructions.style.display = 'none';

// Ask the browser to lock the pointer
element.requestPointerLock = element.requestPointerLock || element.mozRequestPointerLock || element.webkitRequestPointerLock;

if ( /Firefox/i.test( navigator.userAgent ) ) {

var fullscreenchange = function ( event ) {

if ( document.fullscreenElement === element || document.mozFullscreenElement === element || document.mozFullScreenElement === element ) {

document.removeEventListener( 'fullscreenchange', fullscreenchange );
document.removeEventListener( 'mozfullscreenchange', fullscreenchange );

element.requestPointerLock();
}

}

document.addEventListener( 'fullscreenchange', fullscreenchange, false );
document.addEventListener( 'mozfullscreenchange', fullscreenchange, false );

element.requestFullscreen = element.requestFullscreen || element.mozRequestFullscreen || element.mozRequestFullScreen || element.webkitRequestFullscreen;

element.requestFullscreen();

} else {

element.requestPointerLock();

}

}, false );

} else {

instructions.innerHTML = 'Your browser doesn\'t seem to support Pointer Lock API';

}

init();
animate();

function init() {

camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 1000 );

scene = new THREE.Scene();
scene.fog = new THREE.Fog( 0xffffff, 0, 750 );

var light = new THREE.DirectionalLight( 0xffffff, 0.75 );
light.position.set( -1, - 0.5, -1 );
scene.add( light );

controls = new THREE.PointerLockControls( camera );
scene.add( controls.getObject() );

ray = new THREE.Raycaster();
ray.ray.direction.set( 0, -1, 0 );

// floor
      var lemn = new THREE.MeshLambertMaterial({
        map: THREE.ImageUtils.loadTexture('crate.jpg')
      });
geometry = new THREE.PlaneGeometry( 2000, 2000, 100, 100 );
geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );


var stone = THREE.ImageUtils.loadTexture('stone-wall.jpg');
stone.wrapS = stone.wrapT = THREE.RepeatWrapping;
stone.repeat.set( 32, 32 );mesh = new THREE.Mesh( geometry, stonematerial );
scene.add( mesh );


//

renderer = new THREE.WebGLRenderer();
renderer.setClearColor( 0xffffff );
renderer.setSize( window.innerWidth, window.innerHeight );

document.body.appendChild( renderer.domElement );

//

window.addEventListener( 'resize', onWindowResize, false );
}

function onWindowResize() {

camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();

renderer.setSize( window.innerWidth, window.innerHeight );

}

function animate() {

requestAnimationFrame( animate );

//

controls.isOnObject( false );

ray.ray.origin.copy( controls.getObject().position );
ray.ray.origin.y -= 10;

var intersections = ray.intersectObjects( objects );

if ( intersections.length > 0 ) {

var distance = intersections[ 0 ].distance;

if ( distance > 0 && distance < 10 ) {

controls.isOnObject( true );

}

}

controls.update( Date.now() - time );

renderer.render( scene, camera );

time = Date.now();

}
      });

@@ -3601,16 +3601,80 @@
 2, 32 );
+%0Astonematerial = new THREE.MeshBasicMaterial( %7B map: stone %7D );%0A
 mesh = n
@@ -3736,16 +3736,17 @@
 sh );%0A%0A%0A
+%0A
 //%0A%0Arend

Add person look2