1images = Array(); 2showing_image = new THREE.Mesh( new THREE.CubeGeometry(2.5,2.5, 0), new THREE.MeshBasicMaterial( {} ) ); 3showing_image.position.z = INITIAL_CAMERA_POSITION.z * 2; 4background_image = new THREE.Mesh( new THREE.CubeGeometry(5,5, 0), new THREE.MeshBasicMaterial( {} ) ); 5background_image.position.z = INITIAL_CAMERA_POSITION.z * 2 + 0.01; 6 7var texture_loader = new THREE.TextureLoader(); 8 9var image_urls = Array(); 10image_urls.push( "http://hamishtodd1.github.io/HepCardboard/Data/Hepatitis victim.png" ); 11image_urls.push( "http://hamishtodd1.github.io/HepCardboard/Data/Murrays.png" ); 12image_urls.push( "http://hamishtodd1.github.io/HepCardboard/Data/vaccine administered.jpg" ); 13image_urls.push( "http://hamishtodd1.github.io/HepCardboard/Data/yeast.png" ); 14 15function set_up_pictures() 16{ 17 var image_selector_size = 0.09; 18 19 for(var i = 0; i < image_urls.length; i++ ) 20 { 21 images[i] = new THREE.Mesh( new THREE.CubeGeometry(image_selector_size,image_selector_size, 0), 22 new THREE.MeshBasicMaterial( {} ) ); 23 24 images[i].position.z = INITIAL_CAMERA_POSITION.z * 2; 25 images[i].position.applyAxisAngle( Central_Y_axis, TAU / image_urls.length * i ); 26 images[i].lookAt(new THREE.Vector3(0,0,0)); 27 28 load_picture(i); 29 } 30} 31 32function load_picture(index) 33{ 34 texture_loader.load( 35 image_urls[index], 36 function(texture) { 37 console.log("texture loaded") 38 images[ index ].material.map = texture; 39 40 Scene.add(images[ index ]); 41 }, 42 function ( xhr ) {}, function ( xhr ) { 43 console.log( 'texture loading error, switch to using the other code in this function' ); 44 } 45 ); 46} 47 48function update_pictures(Users) 49{ 50 for(var i = 0; i < images.length; i++) 51 { 52 for( var j = 0; j < Users.length; j++ ) 53 { 54 if(Users[j].Controller.position.distanceTo( images[i].position ) < 0.3 ) 55 { 56 images[i].material.color.r = 0; 57 images[i].material.needsUpdate = true; 58 59 if( Users[j].Gripping && !Users[j].Gripping_previously) 60 { 61 if(images[i].scale.x < 2) 62 images[i].scale.set(16,16,16); 63 else 64 images[i].scale.set(1,1,1); 65 } 66 } 67 else 68 { 69 images[i].material.color.r = 1; 70 images[i].material.needsUpdate = true; 71 } 72 } 73 } 74}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.