blob: 69aec372719123db9b49aa5377d72a477e71e892 [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"> <!-- Fullscreen Landscape on iOS -->
<link rel="stylesheet" href="../common/reset.css">
</head>
<body>
<div id="main"></div>
<script src="../common/echarts.min.js"></script>
<script src="../common/jquery.min.js"></script>
<script src="../common/echarts-gl.js"></script>
<script src="../common/dat.gui.js"></script>
<script>
var chart = echarts.init(document.getElementById('main'));
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: -Math.PI,
max: Math.PI,
step: Math.PI / 20
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20
},
x: function (u, v) {
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
return Math.cos(v);
}
};
}
chart.setOption({
xAxis3D: {
type: 'value'
},
yAxis3D: {
type: 'value'
},
zAxis3D: {
type: 'value'
},
grid3D: {
show: false,
environment: 'none',
axisPointer: {
show: false
},
axisLine: {
lineStyle: {
color: '#fff'
}
},
postEffect: {
enable: true
// SSAO: {
// enable: true,
// radius: 10,
// intensity: 2
// }
},
light: {
main: {
intensity: 1,
shadow: true,
},
ambient: {
intensity: 0
},
ambientCubemap: {
texture: '../texture/pisa.hdr',
exposure: 0,
diffuseIntensity: 0.05
}
},
viewControl: {
// projection: 'orthographic'
}
},
series: [{
type: 'surface',
parametric: true,
shading: 'hatching',
silent: true,
wireframe: {
show: false
},
hatchingMaterial: {
hatchingTextures: [
'../texture/tam/hatch_0.jpg',
'../texture/tam/hatch_1.jpg',
'../texture/tam/hatch_2.jpg',
'../texture/tam/hatch_3.jpg',
'../texture/tam/hatch_4.jpg',
'../texture/tam/hatch_5.jpg'
],
textureTiling: [5, 5]
},
itemStyle: {
color: '#000'
},
parametricEquation: getParametricEquation()
}]
});
window.addEventListener('resize', function () {
chart.resize();
});
</script>
</body>
</html>