248Echarts - 3D 曲面(Parametric Surface Rose)
3D Surface 曲面
2023-09-11 14:15:41 时间
效果图
源代码
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() {
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);
},
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);
},
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));
}
};
}
option = {
toolbox: {
feature: {
saveAsImage: {
backgroundColor: '#111'
}
},
iconStyle: {
normal: {
borderColor: '#fff'
}
},
left: 0
},
xAxis3D: {
type: 'value'
},
yAxis3D: {
type: 'value'
},
zAxis3D: {
type: 'value'
},
grid3D: {
show: false,
axisPointer: {
show: false
},
axisLine: {
lineStyle: {
color: '#fff'
}
},
postEffect: {
enable: true,
SSAO: {
enable: true,
radius: 10,
intensity: 2
},
edge: {
enable: true
}
},
temporalSuperSampling: {
enable: true
},
light: {
main: {
intensity: 3,
shadow: true,
},
ambient: {
intensity: 0
},
ambientCubemap: {
texture: 'data-gl/asset/canyon.hdr',
exposure: 0,
diffuseIntensity: 1,
specularIntensity: 0.5
}
},
viewControl: {
// projection: 'orthographic'
}
},
series: [{
type: 'surface',
parametric: true,
shading: 'realistic',
silent: true,
wireframe: {
show: false
},
realisticMaterial: {
baseTexture: '/asset/get/s/data-1494250104909-SkZtfeAyZ.jpg',
roughness: 0.7,
metalness: 0,
textureTiling: [200, 20]
},
itemStyle: {
color: '#fff'
},
parametricEquation: getParametricEquation()
}]
};
相关文章
- [Qt教程] 第48篇 进阶(八) 3D绘图简介
- [web前端] css3 transition属性实现3d动画效果
- 基于 HTML5 的 WebGL 技术构建 3D 场景(一)
- Unity手游之路<四>3d旋转-四元数,欧拉角和变幻矩阵
- Unity 3D 粒子系统的一点经验
- PythonOCC 3D图形库学习—导入STEP模型
- CSS3 3D transform
- [AngularJS] TweenList 3D + AngularJS Animate
- 3D重构科普
- [ReactVR] Add Shapes Using 3D Primitives in React VR
- 计算机视觉 图像形成 几何图形和变换 3D变换
- C#+OpenGL+FreeType显示3D文字(1) - 从TTF文件导出字形贴图
- 两天学会DirectX 3D之第二天
- 3D游戏引擎设计与实现(12)
- 3D游戏从入门到精通-2
- 3D游戏从入门到精通-12
- 3D立体效果
- 【三】3D匹配Matching之可变形曲面匹配Deformable Surface—refine_deformable_surface_model()算子
- 【三】3D匹配Matching之可变形曲面匹配Deformable Surface—get_deformable_surface_model_param()算子
- 【三】3D匹配Matching之可变形曲面匹配Deformable Surface—get_deformable_surface_matching_result()算子
- 【三】3D匹配Matching之可变形曲面匹配Deformable Surface—Based——find_deformable_surface_model()算子
- 【三】3D匹配Matching之可变形曲面匹配Deformable Surface—Based——clear_deformable_surface_matching_result()算子
- 【三】3D匹配Matching之曲面匹配Surface—Based——find_surface_model()算子
- 【三】3D匹配Matching之曲面匹配Surface—Based——clear_surface_matching_result()算子
- 激光雷达点云3D模型点云数据之ply文件格式