import * as React from 'react' import { GLTFViewer } from './gltf-viewer' import TWEEN from '@tweenjs/tween.js' import './App.css' function animate(time: number) { requestAnimationFrame(animate) TWEEN.update(time) } requestAnimationFrame(animate) function App() { const ref = React.useRef(null) const glTFViewerRef = React.useRef() React.useEffect(() => { const glTFViewer = new GLTFViewer({ antialias: true, }) glTFViewerRef.current = glTFViewer Object.assign(window, { $glTFViewer: glTFViewer }) if (ref.current) glTFViewer.appendTo(ref.current) const callback = async () => { await glTFViewer.load('//vrlab-static.ljcdn.com/release/web/data/Astronaut.f3152ab1.glb') } callback() }) return (
) } export default App