<commit_before><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webvr - htc vive</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<style>
			body {
				font-family: Monospace;
				background-color: #101010;
				color: #fff;
				margin: 0px;
				overflow: hidden;
			}
			a {
				color: #f00;
			}
		</style>
	</head>
	<body>

		<script src="../utils/loading.js"></script>
		<script>
			var threeJSPath = "https://cdn.rawgit.com/mrdoob/three.js/r83/";
			var threeJSExamplesPath = threeJSPath + 'examples/';

			ready(function() {
				loadThreeAndDependents(threeJSPath + 'build/three.js',
					[
						threeJSExamplesPath + 'js/vr/WebVR.js',
						threeJSExamplesPath + 'js/effects/VREffect.js',
						threeJSExamplesPath + 'js/controls/VRControls.js',
						threeJSExamplesPath + 'js/vr/ViveController.js',
						threeJSExamplesPath + 'js/loaders/OBJLoader.js',

						'../../build/datguivr.js'
				]).then(function(){
					createThreeExample();
				})
			})

			function createDatGUI(scene, camera, object, controller1, controller2) {
      			dat.GUIVR.enableMouse( camera );

      			const gui = dat.GUIVR.create( 'Flamboyant Gun' );
      			gui.position.y = 1.5;
      			scene.add( gui );

				gui.add( object.position, 'x', -1, 1 ).step(0.001).name('Position X');
				gui.add( object.position, 'z', -1, 1 ).step(0.001).name('Position Z');
				gui.add( object.rotation, 'y', -Math.PI, Math.PI).step(0.001).name('Rotation');

      			const guiInputController1 = dat.GUIVR.addInputObject( controller1 );
			    scene.add( guiInputController1 );

			    const guiInputController2 = dat.GUIVR.addInputObject( controller2 );
			    scene.add( guiInputController2 );
			}

		</script>

		<script>
		function createThreeExample() { // DAT MODIFIED
			if ( WEBVR.isLatestAvailable() === false ) {

				document.body.appendChild( WEBVR.getMessage() );

			}

			//

			var clock = new THREE.Clock();

			var container;
			var camera, scene, renderer;
			var effect, controls;
			var controller1, controller2;

			var room;

			init();
			animate();

			function init() {

				container = document.createElement( 'div' );
				document.body.appendChild( container );

				var info = document.createElement( 'div' );
				info.style.position = 'absolute';
				info.style.top = '10px';
				info.style.width = '100%';
				info.style.textAlign = 'center';
				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> webgl - htc vive';
				container.appendChild( info );

				scene = new THREE.Scene();

				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.1, 10 );
				scene.add( camera );

				room = new THREE.Mesh(
					new THREE.BoxGeometry( 6, 6, 6, 8, 8, 8 ),
					new THREE.MeshBasicMaterial( { color: 0x404040, wireframe: true } )
				);
				room.position.y = 3;
				scene.add( room );

				scene.add( new THREE.HemisphereLight( 0x606060, 0x404040 ) );

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

				var geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );

				for ( var i = 0; i < 200; i ++ ) {

					var object = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff } ) );

					object.position.x = Math.random() * 4 - 2;
					object.position.y = Math.random() * 4 - 2;
					object.position.z = Math.random() * 4 - 2;

					object.rotation.x = Math.random() * 2 * Math.PI;
					object.rotation.y = Math.random() * 2 * Math.PI;
					object.rotation.z = Math.random() * 2 * Math.PI;

					object.scale.x = Math.random() + 0.5;
					object.scale.y = Math.random() + 0.5;
					object.scale.z = Math.random() + 0.5;

					object.userData.velocity = new THREE.Vector3();
					object.userData.velocity.x = Math.random() * 0.01 - 0.005;
					object.userData.velocity.y = Math.random() * 0.01 - 0.005;
					object.userData.velocity.z = Math.random() * 0.01 - 0.005;

					room.add( object );

				}


				var gun = new THREE.Group(); // DAT MODIFIED
				room.add(gun); // DAT MODIFIED

				var material = new THREE.MeshStandardMaterial();

				var loader = new THREE.OBJLoader();
				loader.setPath(threeJSExamplesPath + 'models/obj/cerberus/' ); // DAT MODIFIED
				loader.load( 'Cerberus.obj', function ( group ) {

					// var material = new THREE.MeshBasicMaterial( { wireframe: true } );

					var loader = new THREE.TextureLoader();
					loader.setCrossOrigin( 'anonymous' );
					loader.setPath( threeJSExamplesPath +'models/obj/cerberus/' ); // DAT MODIFIED

					material.roughness = 1;
					material.metalness = 1;

					material.map = loader.load( 'Cerberus_A.jpg' );
					material.roughnessMap = loader.load( 'Cerberus_R.jpg' );
					material.metalnessMap = loader.load( 'Cerberus_M.jpg' );
					material.normalMap = loader.load( 'Cerberus_N.jpg' );

					material.map.wrapS = THREE.RepeatWrapping;
					material.roughnessMap.wrapS = THREE.RepeatWrapping;
					material.metalnessMap.wrapS = THREE.RepeatWrapping;
					material.normalMap.wrapS = THREE.RepeatWrapping;

					group.traverse( function ( child ) {

						if ( child instanceof THREE.Mesh ) {

							child.material = material;

						}

					} );

					group.position.y = - 2;
					group.rotation.y = - Math.PI / 2;

					//room.add( group );
					gun.add(group);// DAT MODIFIED
				} );

				var loader = new THREE.CubeTextureLoader();
				loader.setCrossOrigin( 'anonymous' );
				loader.setPath( threeJSExamplesPath +  'textures/cube/pisa/' ); // DAT MODIFIED
				material.envMap = loader.load( [
					"px.png", "nx.png",
					"py.png", "ny.png",
					"pz.png", "nz.png"
				] );

				//

				renderer = new THREE.WebGLRenderer( { antialias: true } );
				renderer.setClearColor( 0x505050 );
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );
				renderer.sortObjects = false;<commit_msg>fix texture not loading in Vive example<commit_after><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webvr - htc vive</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<style>
			body {
				font-family: Monospace;
				background-color: #101010;
				color: #fff;
				margin: 0px;
				overflow: hidden;
			}
			a {
				color: #f00;
			}
		</style>
	</head>
	<body>

		<script src="../utils/loading.js"></script>
		<script>
			var threeJSPath = "https://cdn.rawgit.com/mrdoob/three.js/r83/";
			var threeJSExamplesPath = threeJSPath + 'examples/';

			ready(function() {
				loadThreeAndDependents(threeJSPath + 'build/three.js',
					[
						threeJSExamplesPath + 'js/vr/WebVR.js',
						threeJSExamplesPath + 'js/effects/VREffect.js',
						threeJSExamplesPath + 'js/controls/VRControls.js',
						threeJSExamplesPath + 'js/vr/ViveController.js',
						threeJSExamplesPath + 'js/loaders/OBJLoader.js',

						'../../build/datguivr.js'
				]).then(function(){
					createThreeExample();
				})
			})

			function createDatGUI(scene, camera, object, controller1, controller2) {
      			dat.GUIVR.enableMouse( camera );

      			const gui = dat.GUIVR.create( 'Flamboyant Gun' );
      			gui.position.y = 1.5;
      			scene.add( gui );

				gui.add( object.position, 'x', -1, 1 ).step(0.001).name('Position X');
				gui.add( object.position, 'z', -1, 1 ).step(0.001).name('Position Z');
				gui.add( object.rotation, 'y', -Math.PI, Math.PI).step(0.001).name('Rotation');

      			const guiInputController1 = dat.GUIVR.addInputObject( controller1 );
			    scene.add( guiInputController1 );

			    const guiInputController2 = dat.GUIVR.addInputObject( controller2 );
			    scene.add( guiInputController2 );
			}

		</script>

		<script>
		function createThreeExample() { // DAT MODIFIED
			if ( WEBVR.isAvailable() === false ) {

				document.body.appendChild( WEBVR.getMessage() );

			}

			//

			var clock = new THREE.Clock();

			var container;
			var camera, scene, renderer;
			var effect, controls;
			var controller1, controller2;

			var room;

			init();
			animate();

			function init() {

				container = document.createElement( 'div' );
				document.body.appendChild( container );

				var info = document.createElement( 'div' );
				info.style.position = 'absolute';
				info.style.top = '10px';
				info.style.width = '100%';
				info.style.textAlign = 'center';
				info.innerHTML = '<a href="http://threejs.org" target="_blank">three.js</a> webgl - htc vive';
				container.appendChild( info );

				scene = new THREE.Scene();

				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.1, 10 );
				scene.add( camera );

				room = new THREE.Mesh(
					new THREE.BoxGeometry( 6, 6, 6, 8, 8, 8 ),
					new THREE.MeshBasicMaterial( { color: 0x404040, wireframe: true } )
				);
				room.position.y = 3;
				scene.add( room );

				scene.add( new THREE.HemisphereLight( 0x606060, 0x404040 ) );

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

				var geometry = new THREE.BoxGeometry( 0.2, 0.2, 0.2 );

				for ( var i = 0; i < 200; i ++ ) {

					var object = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: Math.random() * 0xffffff } ) );

					object.position.x = Math.random() * 4 - 2;
					object.position.y = Math.random() * 4 - 2;
					object.position.z = Math.random() * 4 - 2;

					object.rotation.x = Math.random() * 2 * Math.PI;
					object.rotation.y = Math.random() * 2 * Math.PI;
					object.rotation.z = Math.random() * 2 * Math.PI;

					object.scale.x = Math.random() + 0.5;
					object.scale.y = Math.random() + 0.5;
					object.scale.z = Math.random() + 0.5;

					object.userData.velocity = new THREE.Vector3();
					object.userData.velocity.x = Math.random() * 0.01 - 0.005;
					object.userData.velocity.y = Math.random() * 0.01 - 0.005;
					object.userData.velocity.z = Math.random() * 0.01 - 0.005;

					room.add( object );

				}


				var gun = new THREE.Group(); // DAT MODIFIED
				room.add(gun); // DAT MODIFIED

				var material = new THREE.MeshStandardMaterial();

				var loader = new THREE.OBJLoader();
				loader.setPath(threeJSExamplesPath + 'models/obj/cerberus/' ); // DAT MODIFIED
				loader.load( 'Cerberus.obj', function ( group ) {

					// var material = new THREE.MeshBasicMaterial( { wireframe: true } );

					var loader = new THREE.TextureLoader();
					loader.setPath( threeJSExamplesPath +'models/obj/cerberus/' ); // DAT MODIFIED

					material.roughness = 1;
					material.metalness = 1;

					material.map = loader.load( 'Cerberus_A.jpg' );
					material.roughnessMap = loader.load( 'Cerberus_R.jpg' );
					material.metalnessMap = loader.load( 'Cerberus_M.jpg' );
					material.normalMap = loader.load( 'Cerberus_N.jpg' );

					material.map.wrapS = THREE.RepeatWrapping;
					material.roughnessMap.wrapS = THREE.RepeatWrapping;
					material.metalnessMap.wrapS = THREE.RepeatWrapping;
					material.normalMap.wrapS = THREE.RepeatWrapping;

					group.traverse( function ( child ) {

						if ( child instanceof THREE.Mesh ) {

							child.material = material;

						}

					} );

					group.position.y = - 2;
					group.rotation.y = - Math.PI / 2;

					//room.add( group );
					gun.add(group);// DAT MODIFIED
				} );

				var loader = new THREE.CubeTextureLoader();
				loader.setPath( threeJSExamplesPath +  'textures/cube/pisa/' ); // DAT MODIFIED
				console.log(loader.path)
				material.envMap = loader.load( [
					"px.png", "nx.png",
					"py.png", "ny.png",
					"pz.png", "nz.png"
				] );

				//

				renderer = new THREE.WebGLRenderer( { antialias: true } );
				renderer.setClearColor( 0x505050 );
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );
				renderer.sortObjects = false;
{'fraction_non_alphanumeric': 0.15419387242591662, 'fraction_numerical': 0.024108488196885988, 'mean_word_length': 2.753377316996544, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 39, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7303673', 'n_tokens_mistral': 5288, 'n_tokens_neox': 4042, 'n_words': 822}