Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
d0f1e33d
Unverified
Commit
d0f1e33d
authored
Jan 11, 2021
by
taisei mima
Committed by
GitHub
Jan 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix with-three-js example (#20897)
parent
d9f1cf00
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
23 deletions
+15
-23
Bird.js
examples/with-three-js/components/Bird.js
+4
-4
next.config.js
examples/with-three-js/next.config.js
+1
-5
package.json
examples/with-three-js/package.json
+7
-7
birds.js
examples/with-three-js/pages/birds.js
+1
-2
boxes.js
examples/with-three-js/pages/boxes.js
+2
-5
No files found.
examples/with-three-js/components/Bird.js
View file @
d0f1e33d
...
@@ -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
>
...
...
examples/with-three-js/next.config.js
View file @
d0f1e33d
const
withTM
=
require
(
'next-transpile-modules'
)([
const
withTM
=
require
(
'next-transpile-modules'
)([
'drei'
,
'three'
])
'drei'
,
'three'
,
'postprocessing'
,
])
module
.
exports
=
withTM
()
module
.
exports
=
withTM
()
examples/with-three-js/package.json
View file @
d0f1e33d
...
@@ -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"
:
"1
6.13
.1"
,
"react"
:
"1
7.0
.1"
,
"react-dom"
:
"1
6.13
.1"
,
"react-dom"
:
"1
7.0
.1"
,
"react-three-fiber"
:
"
4.2.12
"
,
"react-three-fiber"
:
"
5.3.11
"
,
"three"
:
"0.1
18.3
"
"three"
:
"0.1
24.0
"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"next-transpile-modules"
:
"
4.0.2
"
"next-transpile-modules"
:
"
6.0.0
"
},
},
"license"
:
"MIT"
"license"
:
"MIT"
}
}
examples/with-three-js/pages/birds.js
View file @
d0f1e33d
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
>
<
/
>
<
/
>
...
...
examples/with-three-js/pages/boxes.js
View file @
d0f1e33d
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>
,
]
]
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment