import React, { useRef } from 'react'; import { useFrame, useLoader } from '@react-three/fiber'; import { Sphere } from '@react-three/drei'; import * as THREE from 'three'; const Moon = () => { const moonRef = useRef(); const moonTexture = useLoader(THREE.TextureLoader, '/textures/moon_2k.jpg'); useFrame((state) => { if (moonRef.current) { moonRef.current.rotation.y = state.clock.getElapsedTime() * 0.1; } }); const moonMaterial = new THREE.MeshLambertMaterial({ map: moonTexture, emissive: '#111111', emissiveIntensity: 0.5, }); return ( {/* Soft moonlight */} ); }; export default Moon;