Hello!
I found three communities to solve the problem.
It may be difficult to convey the problem due to poor English, but I registered the question because I wanted to solve it so badly.
An error occurs when a gltf object collides with another box.
What is the problem that can be inferred here?
I want to get an answer.
const Model2 = () => {
//const gltf = useGLTF('/tree_of_life/scene.gltf', true);
//const gltf = useGLTF('/tree_of_life/scene.gltf')
const { nodes, materials, scene } = useGLTF('/tree_of_life/scene.gltf')
const [ref] = useConvexPolyhedron(() => ({
mass: 1,
rotation:[-Math.PI / 1, 0, 0],
position:[0, 20, 0],
// args:[3,3,3],
type: 'Dynamic',
}));
// gltf.scene.position.set(0,20,10)
// console.log(gltf.scene)
return (
<>
{/* <primitive ref={ref} object={gltf.scene} dispose={null}> */}
<group ref={ref} position={[0, 0, 0]} rotation={[0, 0, 0]} scale={[0.14, 0.14, 0.14]}>
<mesh geometry={nodes.Object_2.geometry} material={nodes.Object_2.material} />
<mesh geometry={nodes.Object_3.geometry} material={nodes.Object_3.material} />
<mesh geometry={nodes.Object_4.geometry} material={nodes.Object_4.material} />
<mesh geometry={nodes.Object_5.geometry} material={nodes.Object_5.material} />
<mesh geometry={nodes.Object_6.geometry} material={nodes.Object_6.material} />
<mesh geometry={nodes.Object_7.geometry} material={nodes.Object_7.material} />
<mesh geometry={nodes.Object_8.geometry} material={nodes.Object_8.material} />
<mesh geometry={nodes.Object_9.geometry} material={nodes.Object_9.material} />
<mesh geometry={nodes.Object_10.geometry} material={nodes.Object_10.material} />
<mesh geometry={nodes.Object_11.geometry} material={nodes.Object_11.material} />
<mesh geometry={nodes.Object_12.geometry} material={nodes.Object_12.material} />
<mesh geometry={nodes.Object_13.geometry} material={nodes.Object_13.material} />
<mesh geometry={nodes.Object_14.geometry} material={nodes.Object_14.material} />
<mesh geometry={nodes.Object_15.geometry} material={nodes.Object_15.material} />
</group>
{/* </primitive> */}
</>
)
}
(The code with Gltf.)
The code is messed up because of the traces of various attempts. I really want help.
Thank you for reading my poor English.