// Загрузка библиотеки Three.js import * as THREE from ‘three’; // Создание сцены и камеры const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); // Создание рендерера const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); // Загрузка модели из Clo3D const loader = new THREE.GLTFLoader(); loader.load(‘models/model.gltf’, function(gltf) { scene.add(gltf.scene); }, undefined, function(error) { console.error(error); }); // Определение размеров окна и обновление камеры window.addEventListener(‘resize’, function() { const width = window.innerWidth; const height = window.innerHeight; renderer.setSize(width, height); camera.aspect = width / height; camera.updateProjectionMatrix(); }); // Рендеринг сцены function animate() { requestAnimationFrame(animate); renderer.render(scene, camera); } animate();