Files
Robot_Arm/web/view_lingxi_6DUUEF.html
T

49 lines
502 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="three_inline.js"></script>
<style>
body { margin: 0; background: #12151b; overflow: hidden; font-family: sans-serif; }
#c { width: 100vw; height: 100vh; }
#info { position: absolute; top: 10px; left: 10px; color: #fff; font-size: 14px; background: rgba(0,0,0,0.7); padding: 8px 12px; border-radius: 6px; }
</style>
</head>
<body>
<div id="info">lingxi_6DUUEF</div>
<canvas id="c"></canvas>
<script>
const d = {"v": [[-240.5, -51.8, -25.0], [-241.0, -51.8, -25.5], [-240.21, -59.28, -25.5], [-237.89, -66.44, -25.5], [-234.12, -72.96, -25.5], [-229.09, -78.55, -25.5], [-223.0, -82.98, -25.5], [-216.12, -86.04, -25.5], [-208.76, -87.6, -25.5], [-201.24, -87.6, -25.5], [-193.88, -86.04, -25.5], [-187.0, -82.98, -25.5], [-180.91, -78.55, -25.5], [-175.88, -72.96, -25.5], [-172.11, -66.44, -25.5], [-169.79, -59.28, -25.5], [-169.0, -51.8, -25.5], [-169.5, -51.8, -25.0], [-170.28, -59.18, -25.0], [-172.57, -66.24, -25.0], [-176.28, -72.67, -25.0], [-181.25, -78.18, -25.0], [-187.25, -82.54, -25.0], [-194.03, -85.56, -25.0], [-201.29, -87.11, -25.0], [-208.71, -87.11, -25.0], [-215.97, -85.56, -25.0], [-222.75, -82.54, -25.0], [-228.75, -78.18, -25.0], [-233.72, -72.67, -25.0], [-237.43, -66.24, -25.0], [-239.72, -59.18, -25.0], [-143.2, -22.3, 4.32], [-143.2, -22.33, 4.32], [-143.2, -22.35, 4.32], [-143.2, -22.38, 4.32], [-143.7, -22.3, 4.82], [-143.7, -22.46, 4.81], [-143.7, -22.41, 4.82], [-143.7, -22.35, 4.82], [-143.7, -27.4, 4.0], [-143.2, -27.32, 3.51], [-143.2, -27.56, 3.47], [-143.2, -27.8, 3.45], [-143.2, -28.04, 3.45], [-143.7, -28.04, 3.95], [-143.7, -27.83, 3.95], [-143.7, -27.61, 3.97], [-146.8, -51.8, -7.75], [-145.8, -51.8, -8.75], [-145.8, -54.06, -8.45], [-145.8, -56.18, -7.58], [-145.8, -57.99, -6.19], [-145.8, -59.38, -4.37], [-145.8, -60.25, -2.26], [-145.8, -60.55, 0.0], [-145.8, -60.25, 2.26], [-145.8, -59.38, 4.38], [-145.8, -57.99, 6.19], [-145.8, -56.18, 7.58], [-145.8, -54.06, 8.45], [-145.8, -51.8, 8.75], [-146.8, -51.8, 7.75], [-146.8, -53.81, 7.49], [-146.8, -55.67, 6.71], [-146.8, -57.28, 5.48], [-146.8, -58.51, 3.88], [-146.8, -59.29, 2.01], [-146.8, -59.55, 0.0], [-146.8, -59.29, -2.01], [-146.8, -58.51, -3.87], [-146.8, -57.28, -5.48], [-146.8, -55.68, -6.71], [-146.8, -53.81, -7.49], [-151.8, -51.8, 7.75], [-152.8, -51.8, 8.75], [-152.8, -54.06, 8.45], [-152.8, -56.17, 7.58], [-152.8, -57.99, 6.19], [-152.8, -59.38, 4.38], [-152.8, -60.25, 2.26], [-152.8, -60.55, 0.0], [-152.8, -60.25, -2.26], [-152.8, -59.38, -4.37], [-152.8, -57.99, -6.19], [-152.8, -56.17, -7.58], [-152.8, -54.06, -8.45], [-152.8, -51.8, -8.75], [-151.8, -51.8, -7.75], [-151.8, -53.81, -7.49], [-151.8, -55.67, -6.71], [-151.8, -57.28, -5.48], [-151.8, -58.51, -3.87], [-151.8, -59.29, -2.01], [-151.8, -59.55, 0.0], [-151.8, -59.29, 2.01], [-151.8, -58.51, 3.88], [-151.8, -57.28, 5.48], [-151.8, -55.68, 6.71], [-151.8, -53.81, 7.49], [-169.5, -51.8, -18.3], [-169.2, -51.8, -18.0], [-169.98, -59.24, -18.0], [-172.3, -66.36, -18.0], [-176.04, -72.84, -18.0], [-181.05, -78.4, -18.0], [-187.1, -82.8, -18.0], [-193.94, -85.85, -18.0], [-201.26, -87.4, -18.0], [-208.74, -87.4, -18.0], [-216.06, -85.85, -18.0], [-222.9, -82.8, -18.0], [-228.95, -78.4, -18.0], [-233.96, -72.84, -18.0], [-237.7, -66.36, -18.0], [-240.02, -59.24, -18.0], [-240.8, -51.8, -18.0], [-240.5, -51.8, -18.3], [-239.72, -59.18, -18.3], [-237.43, -66.24, -18.3], [-233.72, -72.67, -18.3], [-228.75, -78.18, -18.3], [-222.75, -82.54, -18.3], [-215.97, -85.56, -18.3], [-208.71, -87.11, -18.3], [-201.29, -87.11, -18.3], [-194.03, -85.56, -18.3], [-187.25, -82.54, -18.3], [-181.25, -78.18, -18.3], [-176.28, -72.67, -18.3], [-172.57, -66.24, -18.3], [-170.28, -59.18, -18.3], [-168.3, -51.8, -18.0], [-169.01, -44.64, -18.0], [-171.09, -37.76, -18.0], [-174.49, -31.41, -18.0], [-179.05, -25.85, -18.0], [-184.61, -21.29, -18.0], [-190.96, -17.89, -18.0], [-197.84, -15.81, -18.0], [-205.0, -15.1, -18.0], [-212.16, -15.81, -18.0], [-219.04, -17.89, -18.0], [-225.39, -21.29, -18.0], [-230.95, -25.85, -18.0], [-235.51, -31.41, -18.0], [-238.91, -37.76, -18.0], [-240.99, -44.64, -18.0], [-241.7, -51.8, -18.0], [-168.0, -51.8, -18.3], [-189.69, -18.12, -18.3], [-183.58, -21.63, -18.3], [-178.25, -26.24, -18.3], [-173.89, -31.77, -18.3], [-170.66, -38.03, -18.3], [-168.67, -44.79, -18.3], [-189.97, -18.0, -18.29], [-189.96, -17.99, -18.3], [-220.04, -17.99, -18.3], [-214.2, -15.96, -18.3], [-208.09, -14.93, -18.3], [-201.91, -14.93, -18.3], [-195.8, -15.96, -18.3], [-220.03,
const cv = document.getElementById('c');
const rend = new THREE.WebGLRenderer({canvas: cv, antialias: true});
rend.setSize(1000, 750);
const sc = new THREE.Scene(); sc.background = new THREE.Color(0x12151b);
const cam = new THREE.PerspectiveCamera(40, 1000 / 750, 1, 1000);
sc.add(new THREE.HemisphereLight(0xffffff, 0x444444, 1.2));
const l1 = new THREE.DirectionalLight(0xffffff, 1.5); l1.position.set(200, 300, 400); sc.add(l1);
const l2 = new THREE.DirectionalLight(0x88bbff, 0.8); l2.position.set(-200, -100, -200); sc.add(l2);
const grid = new THREE.GridHelper(300, 20, 0x334455, 0x222b36); sc.add(grid);
const geo = new THREE.BufferGeometry();
const pos = new Float32Array(d.v.length * 3);
for (let i = 0; i < d.v.length; i++) { pos[i*3] = d.v[i][0]; pos[i*3+1] = d.v[i][1]; pos[i*3+2] = d.v[i][2]; }
const idx = new Uint32Array(d.t.length * 3);
for (let i = 0; i < d.t.length; i++) { idx[i*3] = d.t[i][0]; idx[i*3+1] = d.t[i][1]; idx[i*3+2] = d.t[i][2]; }
geo.setAttribute('position', new THREE.BufferAttribute(pos, 3));
geo.setIndex(new THREE.BufferAttribute(idx, 1));
geo.computeVertexNormals();
const mat = new THREE.MeshStandardMaterial({color: 0x2a75d3, metalness: 0.4, roughness: 0.4});
const m = new THREE.Mesh(geo, mat);
geo.computeBoundingSphere();
const bs = geo.boundingSphere;
m.position.sub(bs.center);
sc.add(m);
cam.position.set(bs.radius * 1.5, bs.radius * 1.3, bs.radius * 1.7);
cam.lookAt(0, 0, 0);
rend.render(sc, cam);
</script>
</body>
</html>