diff --git a/packages/playground/src/shared/camera/App.tsx b/packages/playground/src/shared/camera/App.tsx new file mode 100644 index 0000000..3eb2788 --- /dev/null +++ b/packages/playground/src/shared/camera/App.tsx @@ -0,0 +1,117 @@ +import { + editable as e, + RefreshSnapshot, + SheetProvider, + PerspectiveCamera, +} from '@theatre/r3f' +import {Stars} from '@react-three/drei' +import {getProject} from '@theatre/core' +import React, {Suspense, useRef, useState} from 'react' +import {Canvas} from '@react-three/fiber' +import {useGLTF} from '@react-three/drei' +import sceneGLB from './scene.glb' +import type {Mesh} from 'three' + +document.body.style.backgroundColor = '#171717' + +function Model({url}: {url: string}) { + const {nodes} = useGLTF(url) as any + + return ( + + + + + + + + ) +} + +function App() { + const bgs = ['#272730', '#b7c5d1'] + const [bgIndex, setBgIndex] = useState(0) + const bg = bgs[bgIndex] + const cameraTargetRef = useRef(null!) + + return ( +
{ + // return setBgIndex((bgIndex) => (bgIndex + 1) % bgs.length) + }} + style={{ + height: '100vh', + }} + > + + + + + + + + + + + + + + + + + + + + + +
+ ) +} + +export default App diff --git a/packages/playground/src/shared/camera/index.tsx b/packages/playground/src/shared/camera/index.tsx new file mode 100644 index 0000000..5507263 --- /dev/null +++ b/packages/playground/src/shared/camera/index.tsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import App from './App' +import studio from '@theatre/studio' +import extension from '@theatre/r3f/dist/extension' + +studio.extend(extension) +studio.initialize() + +ReactDOM.render(, document.getElementById('root')) diff --git a/packages/playground/src/shared/camera/scene.glb b/packages/playground/src/shared/camera/scene.glb new file mode 100644 index 0000000..ecd74ee Binary files /dev/null and b/packages/playground/src/shared/camera/scene.glb differ