import React, { useRef } from 'react'; import { useFrame, useLoader } from '@react-three/fiber'; import { Sphere } from '@react-three/drei'; import * as THREE from 'three'; const Sun = () => { const sunRef = useRef(); const sunTexture = useLoader(THREE.TextureLoader, '/textures/sun_2k.jpg'); useFrame((state) => { if (sunRef.current) { sunRef.current.rotation.y = state.clock.getElapsedTime() * 0.1; } }); const sunMaterial = new THREE.MeshBasicMaterial({ map: sunTexture, }); return ( {/* Sun lighting */} ); }; export default Sun;