Replies: 2 comments 2 replies
-
I'd probably do something like this as a translation. const MySphere = () => {
const [geom] = React.useState(() => {
const geometry = new SphereBufferGeometry(0.5, 64, 64)
geometry.setAttribute("uv2", new BufferAttribute(geometry.attributes.uv.array, 2))
return geometry
})
return (
<mesh>
<primtive object={geom} />
<meshStandardMaterial aoMap={doorAmbientOcclusionTexture} aoMapIntensity={1} />
</mesh>
)
} There are a few ways to do this, this is just my way because I'd rather transform in one go, you could use |
Beta Was this translation helpful? Give feedback.
2 replies
-
Try this method: https://github.com/jwtea/three-viewer/blob/20744c53faf7ece7ee1bd19bc593a6322f39d002/components/Shapes/Points.jsx#L7 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Basically, how to translate imperative code like this:
with
r3f
?I tried
useUpdate()
but it showssetAttribute
undefined.Thanks.
Beta Was this translation helpful? Give feedback.
All reactions