Unverified Commit d0f1e33d authored by taisei mima's avatar taisei mima Committed by GitHub

Fix with-three-js example (#20897)

parent d9f1cf00
...@@ -25,14 +25,14 @@ const Bird = ({ speed, factor, url, ...props }) => { ...@@ -25,14 +25,14 @@ const Bird = ({ speed, factor, url, ...props }) => {
<scene name="Scene" {...props}> <scene name="Scene" {...props}>
<mesh <mesh
name="Object_0" name="Object_0"
morphTargetDictionary={gltf.__$[1].morphTargetDictionary} morphTargetDictionary={gltf.nodes.Object_0.morphTargetDictionary}
morphTargetInfluences={gltf.__$[1].morphTargetInfluences} morphTargetInfluences={gltf.nodes.Object_0.morphTargetInfluences}
rotation={[1.5707964611537577, 0, 0]} rotation={[1.5707964611537577, 0, 0]}
> >
<bufferGeometry attach="geometry" {...gltf.__$[1].geometry} /> <bufferGeometry attach="geometry" {...gltf.nodes.Object_0.geometry} />
<meshStandardMaterial <meshStandardMaterial
attach="material" attach="material"
{...gltf.__$[1].material} {...gltf.nodes.Object_0.material}
name="Material_0_COLOR_0" name="Material_0_COLOR_0"
/> />
</mesh> </mesh>
......
const withTM = require('next-transpile-modules')([ const withTM = require('next-transpile-modules')(['drei', 'three'])
'drei',
'three',
'postprocessing',
])
module.exports = withTM() module.exports = withTM()
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"drei": "0.0.60", "drei": "2.2.13",
"next": "9.4.4", "next": "10.0.5",
"react": "16.13.1", "react": "17.0.1",
"react-dom": "16.13.1", "react-dom": "17.0.1",
"react-three-fiber": "4.2.12", "react-three-fiber": "5.3.11",
"three": "0.118.3" "three": "0.124.0"
}, },
"devDependencies": { "devDependencies": {
"next-transpile-modules": "4.0.2" "next-transpile-modules": "6.0.0"
}, },
"license": "MIT" "license": "MIT"
} }
import dynamic from 'next/dynamic' import dynamic from 'next/dynamic'
import { Suspense } from 'react' import { Suspense } from 'react'
import { Canvas } from 'react-three-fiber' import { Canvas } from 'react-three-fiber'
import { OrbitControls, StandardEffects } from 'drei' import { OrbitControls } from 'drei'
const Bird = dynamic(() => import('../components/Bird'), { ssr: false }) const Bird = dynamic(() => import('../components/Bird'), { ssr: false })
...@@ -41,7 +41,6 @@ const BirdsPage = (props) => { ...@@ -41,7 +41,6 @@ const BirdsPage = (props) => {
<OrbitControls /> <OrbitControls />
<Suspense fallback={null}> <Suspense fallback={null}>
<Birds /> <Birds />
<StandardEffects smaa />
</Suspense> </Suspense>
</Canvas> </Canvas>
</> </>
......
import { useRef, useState, Suspense } from 'react' import { useRef, useState } from 'react'
import { Canvas, useFrame } from 'react-three-fiber' import { Canvas, useFrame } from 'react-three-fiber'
import { OrbitControls, StandardEffects, Box } from 'drei' import { OrbitControls, Box } from 'drei'
const MyBox = (props) => { const MyBox = (props) => {
const mesh = useRef() const mesh = useRef()
...@@ -39,9 +39,6 @@ const BoxesPage = () => { ...@@ -39,9 +39,6 @@ const BoxesPage = () => {
<MyBox position={[0, 10, 0]} /> <MyBox position={[0, 10, 0]} />
<MyBox position={[0, -10, 0]} /> <MyBox position={[0, -10, 0]} />
<OrbitControls /> <OrbitControls />
<Suspense fallback={null}>
<StandardEffects smaa />
</Suspense>
</Canvas>, </Canvas>,
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment