我尝试在vis.js中使用graph3d.js绘制3d闭合曲面,但我只能绘制函数曲面(x,y) - > ž。有没有办法画出封闭的表面?
快速代码:
// create the 3D elliptope - the set of of 3x3 correlation matrices var steps = 51; var maxval = 1; var valstep = 2 / steps; for (var x = -1; x <= maxval; x+= valstep) { for (var y = -1; y <= maxval; y += valstep) { for (var z = -1; z <= maxval; z += valstep) { det = 1 + 2*x*y*z - x*x - y*y - z*z; if (det >= 0 && det <= 0.05) { data.addRow([x,y,z]); } } } }