1 window.onload = function() {
3 // create and initialize a 3D renderer
4 var r = new X.renderer3D();
8 var skull = new X.mesh();
9 //var fibers = new X.fibers();
10 // .. and associate the .vtk file to it
11 skull.file = 'http://x.babymri.org/?skull.vtk';
12 // .. make it transparent
15 // fibers.file = 'http://x.babymri.org/?cctracks.trk';
16 // fibers.caption = 'The Corpus Callosum:<br>connecting the two hemispheres<br>of the human brain.';
22 // re-position the camera to face the skull
23 r.camera.position = [0, 400, 0];
26 // r.onRender = function() {
28 // rotate the skull around the Z axis
29 // since we moved the camera, it is Z not X
30 //skull.transform.rotateZ(1);
32 // we could also rotate the camera instead which is better in case
33 // we have a lot of objects and want to rotate them all:
35 // r.camera.rotate([1,0]);