255Echarts - 3D 曲面(Theme Roses)

简介: 255Echarts - 3D 曲面(Theme Roses)
效果图

源代码
var sin = Math.sin;
var cos = Math.cos;
var pow = Math.pow;
var sqrt = Math.sqrt;
var cosh = Math.cosh;
var sinh = Math.sinh;
var exp = Math.exp;
var PI = Math.PI;
var square = function (x) {
    return x*x;
}
var mod2 = function (a, b) {
    var c = a % b;
    return c > 0 ? c : (c + b);
}
var theta1 = -(20/9) * PI;
var theta2 = 15 * PI;
function getParametricEquation(dx, dy) {
    return {
        u: {
            min: 0,
            max: 1,
            step: 1 / 24
        },
        v: {
            min: theta1,
            max: theta2,
            step: (theta2 - theta1) / 575
        },
        x: function (x1, theta) {
            var phi = (PI/2)*exp(-theta/(8*PI));
            var y1 = 1.9565284531299512*square(x1)*square(1.2768869870150188*x1-1)*sin(phi);
            var X = 1-square(1.25*square(1-mod2((3.6*theta),(2*PI))/PI)-0.25)/2;
            var r = X*(x1*sin(phi)+y1*cos(phi));
            return r * sin(theta) + dx;
        },
        y: function (x1, theta) {
            var phi = (PI/2)*exp(-theta/(8*PI));
            var y1 = 1.9565284531299512*square(x1)*square(1.2768869870150188*x1-1)*sin(phi);
            var X = 1-square(1.25*square(1-mod2((3.6*theta),(2*PI))/PI)-0.25)/2;
            var r = X*(x1*sin(phi)+y1*cos(phi));
            return r * cos(theta) + dy;
        },
        z: function (x1, theta) {
            var phi = (PI/2)*exp(-theta/(8*PI));
            var y1 = 1.9565284531299512*square(x1)*square(1.2768869870150188*x1-1)*sin(phi);
            var X = 1-square(1.25*square(1-mod2((3.6*theta),(2*PI))/PI)-0.25)/2;
            var r = X*(x1*sin(phi)+y1*cos(phi));
            return X*(x1*cos(phi)-y1*sin(phi));
        }
    };
}
function createSeries(dx, dy, color) {
    return {
        type: 'surface',
        parametric: true,
        shading: 'realistic',
        silent: true,
        wireframe: {
            show: false
        },
        realisticMaterial: {
            roughness: 0.7,
            metalness: 0,
            textureTiling: [200, 20]
        },
        parametricEquation: getParametricEquation(dx, dy)
    };
}
option = {
    toolbox: {
        feature: {
            saveAsImage: {
                backgroundColor: '#111'
            }
        },
        iconStyle: {
            normal: {
                borderColor: '#fff'
            }
        },
        left: 0
    },
    xAxis3D: {
        type: 'value'
    },
    yAxis3D: {
        type: 'value'
    },
    zAxis3D: {
        type: 'value'
    },
    grid3D: {
        show: false,
        boxWidth: 200,
        boxDepth: 200,
        axisPointer: {
            show: false
        },
        axisLine: {
            lineStyle: {
                color: '#fff'
            }
        },
        postEffect: {
            enable: true,
            SSAO: {
                enable: true,
                radius: 10,
                intensity: 1
            }
        },
        temporalSuperSampling: {
            enable: true
        },
        light: {
            main: {
                intensity: 1,
                shadow: true,
            },
            ambient: {
                intensity: 0
            },
            ambientCubemap: {
                texture: 'data-gl/asset/pisa.hdr',
                exposure: 1,
                diffuseIntensity: 1,
                specularIntensity: 1
            }
        },
        viewControl: {
            // projection: 'orthographic'
        }
    },
    series: [
        createSeries(1.5, 1.5),
        createSeries(-1.5, -1.5),
        createSeries(-1.5, 1.5),
        createSeries(1.5, -1.5),
        createSeries(0, 0),
    ]
};


目录
相关文章
|
8月前
235Echarts - 3D 柱状图(Voxelize image)
235Echarts - 3D 柱状图(Voxelize image)
50 0
235Echarts - 3D 柱状图(Voxelize image)
|
8月前
105Echarts - K 线图(Basic Candlestick)
105Echarts - K 线图(Basic Candlestick)
34 0
|
1月前
|
数据可视化 C++ 索引
C++ Qt开发:Charts折线图绘制详解
Qt 是一个跨平台C++图形界面开发库,利用Qt可以快速开发跨平台窗体应用程序,在Qt中我们可以通过拖拽的方式将不同组件放到指定的位置,实现图形化开发极大的方便了开发效率,本章将重点介绍`QCharts`折线图的常用方法及灵活运用。 折线图(Line Chart)是一种常用的数据可视化图表,用于展示随着时间、类别或其他有序变量而变化的趋势。折线图通过将数据点连接起来形成折线,直观地展示了变量之间的趋势和关系。
114 0
C++ Qt开发:Charts折线图绘制详解
|
8月前
25Echarts - 折线图(Tooltip and DataZoom on Mobile)
25Echarts - 折线图(Tooltip and DataZoom on Mobile)
36 0
|
8月前
110Echarts - 雷达图(Customized Radar Chart)
110Echarts - 雷达图(Customized Radar Chart)
27 0
|
8月前
249Echarts - 3D 曲面(Simple Surface)
249Echarts - 3D 曲面(Simple Surface)
65 0
|
8月前
56Echarts - 饼图(Customized Pie)
56Echarts - 饼图(Customized Pie)
27 0
|
8月前
60Echarts - 饼图(Texture on Pie Chart)
60Echarts - 饼图(Texture on Pie Chart)
21 0
|
8月前
238Echarts - 3D 柱状图(Metal Bar3D)
238Echarts - 3D 柱状图(Metal Bar3D)
25 0
|
8月前
114Echarts - 盒须图(Boxplot Light Velocity2)
114Echarts - 盒须图(Boxplot Light Velocity2)
52 0