Lina324 commited on
Commit
cdd2b54
·
verified ·
1 Parent(s): c7852ab

Delete surgery.html

Browse files
Files changed (1) hide show
  1. surgery.html +0 -108
surgery.html DELETED
@@ -1,108 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Bio-Harmony VR Operating Theater</title>
7
- <style>
8
- body { margin: 0; padding: 0; overflow: hidden; background-color: #000; font-family: sans-serif; }
9
- #canvas-container { width: 100vw; height: 100vh; position: relative; }
10
- </style>
11
- <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
12
- <script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/loaders/GLTFLoader.js"></script>
13
- <script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/webxr/VRButton.js"></script>
14
- </head>
15
- <body>
16
-
17
- <div id="canvas-container"></div>
18
-
19
- <script>
20
- let scene, camera, renderer, heart;
21
-
22
- function init() {
23
- const container = document.getElementById('canvas-container');
24
-
25
- // Create 3D Graphics Scene
26
- scene = new THREE.Scene();
27
-
28
- // Setup Perspective Camera
29
- camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
30
- camera.position.set(0, 1.2, 2.5);
31
-
32
- // Initialize WebGL Renderer with WebXR capabilities
33
- renderer = new THREE.WebGLRenderer({ antialias: true });
34
- renderer.setSize(window.innerWidth, window.innerHeight);
35
- renderer.xr.enabled = true;
36
- container.appendChild(renderer.domElement);
37
-
38
- // Inject the official VR Mode Activation Button
39
- document.body.appendChild(VRButton.createButton(renderer));
40
-
41
- // Construct Virtual Operating Room Box
42
- const roomGeo = new THREE.BoxGeometry(15, 8, 15);
43
- const roomMat = new THREE.MeshStandardMaterial({ color: 0x0f172a, side: THREE.BackSide, roughness: 0.7 });
44
- const room = new THREE.Mesh(roomGeo, roomMat);
45
- scene.add(room);
46
-
47
- // Construct Surgical Operating Table
48
- const tableGeo = new THREE.BoxGeometry(2.5, 0.7, 4);
49
- const tableMat = new THREE.MeshStandardMaterial({ color: 0x1e293b, roughness: 0.5 });
50
- const table = new THREE.Mesh(tableGeo, tableMat);
51
- table.position.set(0, 0, 0);
52
- scene.add(table);
53
-
54
- // Construct Medical Wireframe Telemetry Hologram Screens
55
- const screenGeo = new THREE.PlaneGeometry(2, 1.2);
56
- const screenMat = new THREE.MeshBasicMaterial({ color: 0x0ea5e9, wireframe: true, transparent: true, opacity: 0.3 });
57
- const screen1 = new THREE.Mesh(screenGeo, screenMat);
58
- screen1.position.set(-3, 2, -2);
59
- screen1.rotation.y = 0.5;
60
- scene.add(screen1);
61
-
62
- // Setup Focused Surgical Overhead Lighting
63
- const surgicalLight = new THREE.SpotLight(0xffffff, 8);
64
- surgicalLight.position.set(0, 4, 0);
65
- surgicalLight.target = table;
66
- scene.add(surgicalLight);
67
-
68
- // Setup Ambient Environmental Lights
69
- const ambientLight = new THREE.AmbientLight(0x334155, 1.5);
70
- scene.add(ambientLight);
71
-
72
- // Load the external 3D Heart Mesh Object directly from space files
73
- const loader = new THREE.GLTFLoader();
74
- loader.load('file/heart.glb', function (gltf) {
75
- heart = gltf.scene;
76
- heart.scale.set(0.35, 0.35, 0.35);
77
- heart.position.set(0, 0.7, 0);
78
- scene.add(heart);
79
- animate();
80
- }, undefined, function (e) { console.error(e); });
81
-
82
- window.addEventListener('resize', onWindowResize);
83
- }
84
-
85
- // Adapt layout automatically on screen size changes
86
- function onWindowResize() {
87
- camera.aspect = window.innerWidth / window.innerHeight;
88
- camera.updateProjectionMatrix();
89
- renderer.setSize(window.innerWidth, window.innerHeight);
90
- }
91
-
92
- // Execution rendering loop featuring rotational behavior and smooth cardiac pulse animations
93
- function animate() {
94
- renderer.setAnimationLoop(function () {
95
- if (heart) {
96
- let pulse = 0.35 + Math.sin(Date.now() * 0.005) * 0.015;
97
- heart.scale.set(pulse, pulse, pulse);
98
- heart.rotation.y += 0.003;
99
- }
100
- renderer.render(scene, camera);
101
- });
102
- }
103
-
104
- // Launch everything on screen boot
105
- init();
106
- </script>
107
- </body>
108
- </html>