// Three.js көмегімен 3 кезеңді зауыттың 3D сценасы
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0f172a);
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
// Жарықтандыру
const ambientLight = new THREE.AmbientLight(0xffffff, 0.7);
scene.add(ambientLight);
const dirLight = new THREE.DirectionalLight(0xffffff, 0.8);
dirLight.position.set(10, 20, 10);
scene.add(dirLight);
// 1-этап: Шредер мен труба цехы (Көк түс)
const m1Geo = new THREE.BoxGeometry(2, 3, 2);
const m1Mat = new THREE.MeshStandardMaterial({ color: 0x3b82f6 });
const stage1 = new THREE.Mesh(m1Geo, m1Mat);
stage1.position.set(-6, 1.5, 0);
scene.add(stage1);
// 2-этап: Пластик турау және оқу құралдары цехы (Жасыл түс)
const m2Geo = new THREE.BoxGeometry(2, 2, 2);
const m2Mat = new THREE.MeshStandardMaterial({ color: 0x10b981 });
const stage2 = new THREE.Mesh(m2Geo, m2Mat);
stage2.position.set(-2, 1, 0);
scene.add(stage2);
// 3-этап: Биогаз және жылу пеші (Қызғылт сары түс)
const furnaceGeo = new THREE.CylinderGeometry(1.5, 1.5, 3, 32);
const furnaceMat = new THREE.MeshStandardMaterial({ color: 0xf97316 });
const furnace = new THREE.Mesh(furnaceGeo, furnaceMat);
furnace.position.set(2, 1.5, 0);
scene.add(furnace);
// Карбонсыз Скруббер және таза ауа шығару модулі (Көгілдір түс)
const scrubberGeo = new THREE.CylinderGeometry(1, 1, 4, 32);
const scrubberMat = new THREE.MeshStandardMaterial({ color: 0x06b6d4 });
const scrubber = new THREE.Mesh(scrubberGeo, scrubberMat);
scrubber.position.set(6, 2, 0);
scene.add(scrubber);
camera.position.set(0, 6, 14);
camera.lookAt(0, 1, 0);
// Анимация циклі
function animate() {
requestAnimationFrame(animate);
// Пеш мен скруббердің жұмыс істеп тұрғанын көрсету үшін жеңіл айналдыру
furnace.rotation.y += 0.01;
scrubber.rotation.y -= 0.005;
renderer.render(scene, camera);
}
animate();
