diff --git a/src/img/.1689114993528.jpeg b/src/img/.1689114993528.jpeg deleted file mode 100755 index 633abe6..0000000 Binary files a/src/img/.1689114993528.jpeg and /dev/null differ diff --git a/src/img/.MOSHED-2024-7-25-20-14-55.jpg b/src/img/.MOSHED-2024-7-25-20-14-55.jpg deleted file mode 100755 index 4a65232..0000000 Binary files a/src/img/.MOSHED-2024-7-25-20-14-55.jpg and /dev/null differ diff --git a/src/img/.Snapchat-877674815.jpg b/src/img/.Snapchat-877674815.jpg deleted file mode 100644 index 1167a95..0000000 Binary files a/src/img/.Snapchat-877674815.jpg and /dev/null differ diff --git a/src/img/2k_ceres_fictional.jpg b/src/img/2k_ceres_fictional.jpg new file mode 100644 index 0000000..1019e23 Binary files /dev/null and b/src/img/2k_ceres_fictional.jpg differ diff --git a/src/img/2k_haumea_fictional.jpg b/src/img/2k_haumea_fictional.jpg new file mode 100644 index 0000000..da3ccc3 Binary files /dev/null and b/src/img/2k_haumea_fictional.jpg differ diff --git a/src/img/2k_jupiter.jpg b/src/img/2k_jupiter.jpg new file mode 100644 index 0000000..21f1951 Binary files /dev/null and b/src/img/2k_jupiter.jpg differ diff --git a/src/img/2k_makemake_fictional.jpg b/src/img/2k_makemake_fictional.jpg new file mode 100644 index 0000000..a0719ab Binary files /dev/null and b/src/img/2k_makemake_fictional.jpg differ diff --git a/src/img/2k_stars_milky_way.jpg b/src/img/2k_stars_milky_way.jpg new file mode 100644 index 0000000..b7e0a1e Binary files /dev/null and b/src/img/2k_stars_milky_way.jpg differ diff --git a/src/index/Canvas.tsx b/src/index/Canvas.tsx index 1604a3a..b22cb99 100644 --- a/src/index/Canvas.tsx +++ b/src/index/Canvas.tsx @@ -1,10 +1,15 @@ import "./canvas.sass"; import {motion} from "framer-motion"; -import {Canvas as ThreeCanvas, useFrame} from "@react-three/fiber"; -import {Vector3} from "three"; +import {Canvas as ThreeCanvas} from "@react-three/fiber"; import {Moon} from "./Moon"; -import {Stars} from "./Stars"; import {AnimateSpin} from "../animations"; +import {Environment, OrbitControls, useTexture} from "@react-three/drei"; +import Jupiter from "../img/2k_jupiter.jpg"; +import Makemake from "../img/2k_makemake_fictional.jpg"; +import Ceres from "../img/2k_ceres_fictional.jpg"; +import Haumea from "../img/2k_haumea_fictional.jpg"; +import MilkyWay from "../img/2k_stars_milky_way.jpg"; +import {Suspense} from "react"; export default function Canvas() { @@ -12,12 +17,13 @@ export default function Canvas() {
- - - - - - + + + + + + +
@@ -27,18 +33,23 @@ export default function Canvas() { ) } +function Moons() { + const makemake = useTexture(Makemake); + const haumea = useTexture(Haumea); + const ceres = useTexture(Ceres); + + return <> + + + + +} + function Sphere() { - useFrame(state => { - const { x, y } = state.pointer - // Smoothly interpolate the camera position - // We multiply by a factor (e.g., 5) to increase the range of movement - state.camera.position.lerp(new Vector3(x * 10, y * 10, 5), 0.1) - // Always keep the camera looking at the center - state.camera.lookAt(0, 0, 0) - }) + const colorMap = useTexture(Jupiter); return - + } \ No newline at end of file diff --git a/src/index/Moon.tsx b/src/index/Moon.tsx index 17f6955..11cbba4 100644 --- a/src/index/Moon.tsx +++ b/src/index/Moon.tsx @@ -2,8 +2,8 @@ import {useRef, useState} from "react"; import {Mesh} from "three"; import {useFrame} from "@react-three/fiber"; -export function Moon(props: {radius: number, color: string, step: number}) { - const {radius, color, step} = props; +export function Moon(props: {radius: number, color: string, map: any, step: number}) { + const {radius, color, map, step} = props; const moonRef = useRef(null); const [theta, setTheta] = useState(0); @@ -22,7 +22,7 @@ export function Moon(props: {radius: number, color: string, step: number}) { return ( - + ) } \ No newline at end of file diff --git a/src/index/Stars.tsx b/src/index/Stars.tsx deleted file mode 100644 index 0c2c95e..0000000 --- a/src/index/Stars.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import {useMemo} from "react"; - -const RADIUS = 20; -const COUNT = 100; -type Coordinate = [number, number, number]; -export function Stars() { - const positions = useMemo(() => { - const positions: Coordinate[] = []; - for(let i = 0; i < COUNT; i++) { - const u = Math.random(); - const v = Math.random(); - - const theta = 2 * Math.PI * u; - const phi = Math.acos(2 * v - 1); - - // x = r*sin(theta)*cos(phi) - // x = r*sin(theta)*sin(phi) - // z = r*cos(phi) - positions.push([ - RADIUS * Math.sin(phi) * Math.cos(theta), - RADIUS * Math.sin(phi) * Math.sin(theta), - RADIUS * Math.cos(phi), - ]) - } - return positions; - }, []); - - return positions.map((coord, i) => - - - - ) -}