Difference between revisions of "Team:Hawaii/Gina"

Line 31: Line 31:
 
<script>
 
<script>
 
window.onload = function() {
 
window.onload = function() {
  let loadTime = window.performance.timing.domContentLoadedEventEnd-window.performance.timing.navigationStart;
 
  console.log('Page load time is '+ loadTime);
 
 
  let container, scene, camera, renderer, light, controls;
 
 
   let lightIntensity = 1.4;
 
   let lightIntensity = 1.4;
 
  let targetRotationX = 0;
 
  let targetRotationOnMouseDownX = 0;
 
 
  let targetRotationY = 0;
 
  let targetRotationOnMouseDownY = 0;
 
 
  let mouseX = 0;
 
  let mouseXOnMouseDown = 0;
 
 
  let mouseY = 0;
 
  let mouseYOnMouseDown = 0;
 
 
 
   let windowHalfX = window.innerWidth/2;
 
   let windowHalfX = window.innerWidth/2;
 
   let windowHalfY = window.innerHeight/2;
 
   let windowHalfY = window.innerHeight/2;
Line 56: Line 39:
 
   let SPEED = 0.01;
 
   let SPEED = 0.01;
  
   let raycaster = new THREE.Raycaster();
+
   let cube = null;
  let mouse = new THREE.Vector2(), INTERSECTED, CLICKINTERSECTED;
+
  let intersects;
+
  let currentMeshName;
+
 
+
  
 
   init();
 
   init();
Line 69: Line 48:
 
     container = document.createElement('div');
 
     container = document.createElement('div');
 
     document.body.appendChild(container);
 
     document.body.appendChild(container);
 
 
     scene = new THREE.Scene();
 
     scene = new THREE.Scene();
  
Line 78: Line 56:
  
 
     // initMesh
 
     // initMesh
     // let mesh = null;
+
     let size = 3;
     // let loader = new THREE.JSONLoader();
+
     let geometry = new THREE.BoxGeometry( size, size, size );
     // let name = './marmelab.json';
+
     for ( var i = 0; i < geometry.faces.length; i ++ ) {
    // loader.load(name, function(geometry, materials) {
+
        geometry.faces[i].color.setHex(Math.random() * 0xffffff);
    //  mesh = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial(materials));
+
     }
    //  mesh.rotation.y= -10;
+
     let material = new THREE.MeshBasicMaterial( { color: 0xffffff, vertexColors: THREE.FaceColors } );
    //  scene.add(mesh);
+
     cube = new THREE.Mesh( geometry, material );
     // });
+
     cube.translation = THREE.GeometryUtils.center(geometry);
     var geometry = new THREE.BoxGeometry( 1, 1, 1 );
+
     var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
+
     var cube = new THREE.Mesh( geometry, material );
+
 
     scene.add( cube );
 
     scene.add( cube );
  
Line 112: Line 87:
 
     camera.updateProjectionMatrix();
 
     camera.updateProjectionMatrix();
 
     renderer.setSize(window.innerWidth, window.innerHeight);
 
     renderer.setSize(window.innerWidth, window.innerHeight);
 +
  }
 +
 +
  function rotateMesh() {
 +
    if (!cube) {
 +
      return;
 +
    }
 +
    cube.rotation.x -= SPEED*2;
 +
    cube.rotation.y -= SPEED;
 +
    cube.rotation.z -= SPEED*3;
 
   }
 
   }
  
 
   function render() {
 
   function render() {
 
     renderer.render(scene,camera);
 
     renderer.render(scene,camera);
 +
    rotateMesh();
 
   }
 
   }
  

Revision as of 19:44, 17 May 2018



RESEARCH JOURNAL


This is where you write things.

5/16/18; Super Cool Protein Purification

Today we purified this super cool protein.

Test Hello