Template:Team:UC Davis/KO3D

From 2013.igem.org

(Difference between revisions)
Line 281: Line 281:
/*
/*
-
         var particle = new THREE.Vertex(
+
         particle = new THREE.Vertex(
                 new THREE.Vector3(thisdatax[i%thisdatax.length]/axisdimensions[1]*100,  
                 new THREE.Vector3(thisdatax[i%thisdatax.length]/axisdimensions[1]*100,  
                 thisdatay[Math.floor(i/thisdatax.length)]/axisdimensions[3]*100,  
                 thisdatay[Math.floor(i/thisdatax.length)]/axisdimensions[3]*100,  
Line 287: Line 287:
                 );
                 );
         particles[index].vertices.push(particle);
         particles[index].vertices.push(particle);
-
var newparticle = new THREE.Particle(pointMaterial)
+
newparticle = new THREE.Particle(pointMaterial)
newparticle.position.x = particle.position.x;
newparticle.position.x = particle.position.x;
newparticle.position.y = particle.position.y;
newparticle.position.y = particle.position.y;
Line 296: Line 296:
          
          
             }
             }
-
         var lineMat = new THREE.LineBasicMaterial(
+
         lineMat = new THREE.LineBasicMaterial(
             {
             {
             color:mutantcolors_hex[index],
             color:mutantcolors_hex[index],
Line 306: Line 306:
         {
         {
             thisdataerr[i] = parseFloat(thisdataerr[i]);
             thisdataerr[i] = parseFloat(thisdataerr[i]);
-
             var errbargeom = new THREE.Geometry();
+
             errbargeom = new THREE.Geometry();
             errbargeom.vertices.push(new THREE.Vertex(new THREE.Vector3(
             errbargeom.vertices.push(new THREE.Vertex(new THREE.Vector3(
                 thisdatax[i%thisdatax.length]/axisdimensions[1]*100,
                 thisdatax[i%thisdatax.length]/axisdimensions[1]*100,
Line 317: Line 317:
                 thisdataz[i]/axisdimensions[5]*100+thisdataerr[i]/axisdimensions[5]*100
                 thisdataz[i]/axisdimensions[5]*100+thisdataerr[i]/axisdimensions[5]*100
             )));
             )));
-
             var errbar = new THREE.Line(errbargeom, lineMat);
+
             errbar = new THREE.Line(errbargeom, lineMat);
             errorbars_3d[index].addChild(errbar);
             errorbars_3d[index].addChild(errbar);
         }
         }
Line 326: Line 326:
         {
         {
-
             var linegeom = new THREE.Geometry();
+
             linegeom = new THREE.Geometry();
             linegeom.vertices.push(new THREE.Vertex(new THREE.Vector3(
             linegeom.vertices.push(new THREE.Vertex(new THREE.Vector3(
                 thisdatax[i%thisdatax.length]/axisdimensions[1]*100,
                 thisdatax[i%thisdatax.length]/axisdimensions[1]*100,
Line 343: Line 343:
             //Particles look like ass.
             //Particles look like ass.
             //Use lines instead.
             //Use lines instead.
-
             var linegeom = new THREE.Geometry();
+
             linegeom = new THREE.Geometry();
             linegeom.vertices.push(new THREE.Vertex(new THREE.Vector3(
             linegeom.vertices.push(new THREE.Vertex(new THREE.Vector3(
                 thisdatax[i%(thisdatax.length-1)]/axisdimensions[1]*100,
                 thisdatax[i%(thisdatax.length-1)]/axisdimensions[1]*100,
Line 719: Line 719:
     renderer.render(scene, camera);
     renderer.render(scene, camera);
 +
$('#mw_grapharea').append('<div id="mw_3dplot"/>');
update3DPlotMeshes();
update3DPlotMeshes();
}
}

Revision as of 02:22, 28 October 2013