awacke1 commited on
Commit
eafcff0
·
1 Parent(s): 09c7acd

Create backup.html

Browse files
Files changed (1) hide show
  1. backup.html +51 -0
backup.html ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Three.js Scene and Animation Example</title>
5
+ <style>
6
+ body {
7
+ margin: 0;
8
+ padding: 0;
9
+ }
10
+ canvas {
11
+ display: block;
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <script src="https://threejs.org/build/three.min.js"></script>
17
+ <script>
18
+ // Set up the scene, camera, and renderer
19
+ const scene = new THREE.Scene();
20
+ const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
21
+ const renderer = new THREE.WebGLRenderer();
22
+ renderer.setSize(window.innerWidth, window.innerHeight);
23
+ document.body.appendChild(renderer.domElement);
24
+
25
+ // Create a cube geometry and material
26
+ const geometry = new THREE.BoxGeometry();
27
+ const material = new THREE.MeshBasicMaterial({ color: 0xffffff });
28
+
29
+ // Create a cube mesh and add it to the scene
30
+ const cube = new THREE.Mesh(geometry, material);
31
+ scene.add(cube);
32
+
33
+ // Set up animation loop
34
+ const animate = function () {
35
+ requestAnimationFrame(animate);
36
+
37
+ // Rotate the cube
38
+ cube.rotation.x += 0.01;
39
+ cube.rotation.y += 0.01;
40
+
41
+ renderer.render(scene, camera);
42
+ };
43
+
44
+ // Start the animation loop
45
+ animate();
46
+
47
+ // Adjust camera position
48
+ camera.position.z = 5;
49
+ </script>
50
+ </body>
51
+ </html>