]> Creatis software - creaWT.git/blobdiff - wt/bbtk_wt_PKG/src/nn/js/demo/demo2.js
2498 BBTK FeatureNewNormal wt-version PackageWt
[creaWT.git] / wt / bbtk_wt_PKG / src / nn / js / demo / demo2.js
diff --git a/wt/bbtk_wt_PKG/src/nn/js/demo/demo2.js b/wt/bbtk_wt_PKG/src/nn/js/demo/demo2.js
new file mode 100644 (file)
index 0000000..b35e9d0
--- /dev/null
@@ -0,0 +1,49 @@
+window.onload = function() {
+
+  // create and initialize a 3D renderer
+  var r = new X.renderer3D();
+  r.init();
+  
+  // create a new X.mesh
+  var skull = new X.mesh();
+//var fibers = new X.fibers();
+  // .. and associate the .vtk file to it
+  skull.file = 'http://x.babymri.org/?skull.vtk';
+  // .. make it transparent
+  skull.opacity = 0.7;
+  
+//     fibers.file = 'http://x.babymri.org/?cctracks.trk';
+ // fibers.caption = 'The Corpus Callosum:<br>connecting the two hemispheres<br>of the human brain.';
+
+  // .. add the mesh
+  r.add(skull);
+//     r.add(fibers);
+  
+  // re-position the camera to face the skull
+  r.camera.position = [0, 400, 0];
+  
+  // animate..
+ // r.onRender = function() {
+
+    // rotate the skull around the Z axis
+    // since we moved the camera, it is Z not X
+   //skull.transform.rotateZ(1);
+    
+    // we could also rotate the camera instead which is better in case
+    // we have a lot of objects and want to rotate them all:
+    //
+    // r.camera.rotate([1,0]);
+    
+  //};
+  
+  r.render();
+  
+};
+
+
+
+
+
+
+
+