console
var mathbox = mathBox({
plugins: ['core', 'cursor', 'controls'],
controls: {
klass: THREE.OrbitControls,
},
});
if (mathbox.fallback) throw "WebGL error";
// Set renderer background
var three = mathbox.three;
three.renderer.setClearColor(new THREE.Color(0xffffff), 1.0);
// Set mathbox units and place camera
mathbox.set({
scale: 1000,
focus: 3
});
mathbox.camera({
proxy: true,
position: [0, 0, 3]
});
// Create cartesian view
var view = mathbox.cartesian({
range: [[ - 4, 4], [ - 4, 4]],
scale: [1, 1],
});
view.interval({
expr: function (emit, x, i, t) {
emit(0,0,0);
emit(Math.sin(x), Math.cos(x),0);
emit(Math.sin(x+0.1), Math.cos(x+0.1),0);
},
width: 100,
items:3,
channels: 3,
});
view.face({
color: 0x3090FF,
width: 3,
})
<script src="http://acko.net/files/mathbox2/mathbox-bundle.min.js">
</script>