Template:Team:UC Davis/MutantWidget

From 2011.igem.org

(Difference between revisions)
Line 262: Line 262:
$('#mw_plot').hide();
$('#mw_plot').hide();
$('#mw_3dplot').show();
$('#mw_3dplot').show();
 +
datameshes = [];
 +
$('#mw_selectmenu td').each(
 +
function(index)
 +
{
 +
if($(this).hasClass("selected"))
 +
{
 +
if(plot_mesh[index])
 +
{
 +
datameshes.push(plot_mesh);
 +
}
 +
}
 +
}
 +
);
 +
for(var i = 0;i < plot_mesh.length; i++)
 +
{
 +
plot_obj.removeChild(plot_mesh[i]);
 +
}
 +
for(var i=0;i < datameshes.length; i++)
 +
{
 +
plot_obj.addChild(plot_mesh[i]);
 +
}
 +
renderer.render(scene, camera);
}
}
Line 285: Line 307:
}
}
dataseries = [];
dataseries = [];
-
$('#mutantwidget td').each(
+
$('#mw_selectmenu td').each(
function(index)
function(index)
{
{
Line 311: Line 333:
}else if(widget_mode == "3D")
}else if(widget_mode == "3D")
{
{
 +
datameshes = [];
 +
$('#mw_selectmenu td').each(
 +
function(index)
 +
{
 +
if($(this).hasClass("selected"))
 +
{
 +
if(plot_mesh[index])
 +
{
 +
datameshes.push(plot_mesh);
 +
}
 +
}
 +
}
 +
);
 +
for(var i = 0;i < plot_mesh.length; i++)
 +
{
 +
plot_obj.removeChild(plot_mesh[i]);
 +
}
 +
for(var i=0;i < datameshes.length; i++)
 +
{
 +
plot_obj.addChild(plot_mesh[i]);
 +
}
 +
renderer.render(scene, camera);
}
}
}  
}  
Line 625: Line 669:
// add it to the scene
// add it to the scene
-
+
plot_mesh = [];
-
plot_mesh = new THREE.Mesh(
+
for(var i = 0; i < data_3d.length; ++i)
-
data_3d[0],
+
{
-
plotMaterial
+
plot_mesh.push(new THREE.Mesh(data_3d[0], plotMaterial));
-
);
+
plot_mesh[i].doubleSided = true;
-
plot_mesh.doubleSided = true;
+
}
-
 
+
plot_obj = new THREE.Object3D{};
//plot_mesh.addChild(sphere);
//plot_mesh.addChild(sphere);
Line 663: Line 707:
zaxis.rotation.y = -90*Math.PI/180;
zaxis.rotation.y = -90*Math.PI/180;
-
plot_mesh.position.x = -50;
+
plot_obj.position.x = -50;
-
plot_mesh.position.z = -50;
+
plot_obj.position.z = -50;
-
plot_mesh.position.y = -50;
+
plot_obj.position.y = -50;
zaxis.position.x = -50;
zaxis.position.x = -50;
Line 682: Line 726:
origin_object = new THREE.Object3D();
origin_object = new THREE.Object3D();
origin_camera.addChild(origin_object);
origin_camera.addChild(origin_object);
-
origin_object.addChild(plot_mesh);
+
origin_object.addChild(plot_obj);
-
plot_mesh.addChild(particleSystem);
+
//plot_obj.addChild(particleSystem);
origin_object.rotation.z = Math.PI;
origin_object.rotation.z = Math.PI;

Revision as of 05:46, 26 September 2011