如何使用vis.js graph3d.js绘制闭合曲面?

时间:2016-08-24 09:53:39

标签: javascript 3d surface vis.js

我尝试在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]);
                    }
                }
            }
        }

在表面未关闭的问题下,即只选择两个z值中的一个: not closed surface

0 个答案:

没有答案