我有一个.vtk文件在远程服务器上。我通过http进行访问(我验证了文件的url是正确的,事实上我可以从浏览器下载它)。我也尝试过按照xtk volume rendering with .vtk file created from matlab建议去掉文件中的空格。
但是我收到了一个异常。
请问可以指导我应该使用哪种.vtk文件格式,以便使其顺利工作吗? 我正在按照xtk教程http://jsfiddle.net/gh/get/toolkit/edge/xtk/lessons/tree/master/05/#run进行操作,以下是我的代码。
但是我收到了一个异常。
Unable to get property 'length' of undefined or null reference.
请问可以指导我应该使用哪种.vtk文件格式,以便使其顺利工作吗? 我正在按照xtk教程http://jsfiddle.net/gh/get/toolkit/edge/xtk/lessons/tree/master/05/#run进行操作,以下是我的代码。
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();
};