I have a .vtk file at remote server. I am accessing it via http (I verified that the url of the file is correct, in fact I can download it from the browser). I've also tried to remove the blank spaces from the file as suggested in xtk volume rendering with .vtk file created from matlab.
But i get an exception
Unable to get property 'length' of undefined or null reference.
Can you please guide me the .vtk file format that should be used in order to make it work smoothly ? I am following the xtk tutorial http://jsfiddle.net/gh/get/toolkit/edge/xtk/lessons/tree/master/05/#run, below is my code
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();
// .. and associate the .vtk file to it
skull.file = 'http://localhost/startup/bunnycheck.vtk'; //using other .vtk file
//skull.file = 'http://x.babymri.org/?skull.vtk';
// .. make it transparent
skull.opacity = 0.5;
// .. add the mesh
r.add(skull);
// re-position the camera to face the skull
r.camera.position = [0, 400, 0];
// animate..
r.onRender = function () {
r.camera.rotate([1,0]);
};
r.render();
};