adrianhajdin / project_threejs_ai

https://jsmastery.pro
934 stars 283 forks source link

redline under .geometry . geometry={nodes.T_Shirt_male.geometry} #58

Open berkanioussama opened 11 months ago

berkanioussama commented 11 months ago

Property 'geometry' does not exist on type 'Object3D i use nexjs 14 typescript . not vite js image

berkanioussama commented 10 months ago

i creat another on with js not ts and its work

hannesuw commented 7 months ago

In typescript, you should create a type for GLTF result and assign it to useGLTF hooks.

Create an interface or a type. interface GLTFResult extends GLTF { nodes: { T_Shirt_male: THREE.SkinnedMesh } materials: { lambert1: THREE.MeshStandardMaterial } }

Assign the type to the hooks. const { nodes, materials } = useGLTF("/shirt_baked.glb") as GLTFResult