From aabacdbc1152ae3a0069ef2ae610a0543e3b3520 Mon Sep 17 00:00:00 2001 From: Austin Godber Date: Sun, 14 Apr 2024 17:43:56 -0700 Subject: [PATCH] load texture --- stereo-exp1/src/Experience.jsx | 17 ++++++++--------- stereo-exp1/src/index.jsx | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/stereo-exp1/src/Experience.jsx b/stereo-exp1/src/Experience.jsx index eae95db..f50ef1b 100644 --- a/stereo-exp1/src/Experience.jsx +++ b/stereo-exp1/src/Experience.jsx @@ -1,10 +1,14 @@ import { useThree, extend } from '@react-three/fiber' -import { OrbitControls } from '@react-three/drei' +import { OrbitControls, useTexture } from '@react-three/drei' import { DoubleSide } from 'three' export default function Experience() { const { camera, gl } = useThree() + // const harborSealRockTexture = useTexture('./MARS-Harbor-Seal-Rock-in-Jezero-Crater-cross-eyed-Manzoni_May-1662x2048.jpg') + const goliathTexture = useTexture('https://tile.loc.gov/storage-services/service/pnp/stereo/1s00000/1s00000/1s00600/1s00612v.jpg') + const texture = goliathTexture + const {width, height} = texture.image return <> @@ -12,14 +16,9 @@ export default function Experience() - - - - - - - - + + + } \ No newline at end of file diff --git a/stereo-exp1/src/index.jsx b/stereo-exp1/src/index.jsx index 2977d5b..3a4e303 100644 --- a/stereo-exp1/src/index.jsx +++ b/stereo-exp1/src/index.jsx @@ -11,7 +11,7 @@ root.render( fov: 45, near: 0.1, far: 200, - position: [ - 4, 3, 6 ] + position: [ 0, 5, 20 ] } } >