Template:Team:UC Davis/MutantWidget

From 2011.igem.org

(Difference between revisions)
Line 474: Line 474:
//Axis labels
//Axis labels
 +
var x = document.createElement("canvas");
 +
var xc = x.getContext("2d");
 +
x.width = 400;
 +
x.height = 40;
 +
xc.fillStyle = "#ffffff";
 +
xc.font = "20pt arial";
 +
xc.textBaseline = "top";
 +
xc.fillText("Arabinose (wt%)", 10, 0);
 +
 +
var xm = new THREE.MeshBasicMaterial({
 +
map: new THREE.Texture(x)
 +
});
 +
xm.map.needsUpdate = true;
 +
 +
xaxislabel = new THREE.Mesh(new THREE.PlaneGeometry(400, 40, 2, 2), xm);
 +
xaxislabel.position.x = -2;
 +
xaxislabel.position.y = 50;
 +
xaxislabel.position.z = 0;
 +
        xaxislabel.rotation.z = Math.PI/2;
 +
xaxislabel.scale.x = 0.2;
 +
xaxislabel.scale.y = 0.2;
 +
 +
var x = document.createElement("canvas");
 +
var xc = x.getContext("2d");
 +
x.width = 400;
 +
x.height = 40;
 +
xc.fillStyle = "#ffffff";
 +
xc.font = "20pt arial";
 +
xc.textBaseline = "top";
 +
xc.fillText("IPTG (mM)", 10, 0);
 +
 +
var xm = new THREE.MeshBasicMaterial({
 +
map: new THREE.Texture(x)
 +
});
 +
xm.map.needsUpdate = true;
 +
 +
yaxislabel = new THREE.Mesh(new THREE.PlaneGeometry(400, 40, 2, 2), xm);
 +
yaxislabel.position.x = -2;
 +
yaxislabel.position.y = 50;
 +
yaxislabel.position.z = 0;
 +
        yaxislabel.rotation.z = Math.PI/2;
 +
yaxislabel.scale.x = 0.2;
 +
yaxislabel.scale.y = 0.2;
 +
var x = document.createElement("canvas");
var x = document.createElement("canvas");
var xc = x.getContext("2d");
var xc = x.getContext("2d");

Revision as of 07:04, 25 September 2011