Closed KhayKhun closed 6 months ago
Welcome to gltfjsx!
I have created a quick working demo of this project.
Github: https://github.com/justindhillon/gltfjsx-issue--249 Demo: https://gltfjsx-issue-249.vercel.app/
Screencast from 2024-03-10 23-57-11.webm
Your implementation lacks <Canvas>
. Here is how it is supposed to look like:
"use client"
import { Canvas } from "@react-three/fiber";
import { OrbitControls, PerspectiveCamera } from "@react-three/drei";
import { Avatar } from "./Avatar";
export default function Experience() {
return (
<Canvas>
<OrbitControls />
<Avatar />
<PerspectiveCamera makeDefault position={[30, 30, 20]} />
</Canvas>
);
}
It could always be something wrong with your model or rest of your project files. If you still have issues, link your github repo or send me questions via linkedIn. I'm always happy to help!
Welcome to gltfjsx!
I have created a quick working demo of this project.
Github: https://github.com/justindhillon/gltfjsx-issue--249 Demo: https://gltfjsx-issue-249.vercel.app/ Screencast.from.2024-03-10.23-57-11.webm
Your implementation lacks
<Canvas>
. Here is how it is supposed to look like:"use client" import { Canvas } from "@react-three/fiber"; import { OrbitControls, PerspectiveCamera } from "@react-three/drei"; import { Avatar } from "./Avatar"; export default function Experience() { return ( <Canvas> <OrbitControls /> <Avatar /> <PerspectiveCamera makeDefault position={[30, 30, 20]} /> </Canvas> ); }
It could always be something wrong with your model or rest of your project files. If you still have issues, link your github repo or send me questions via linkedIn. I'm always happy to help!
Thanks for your time. My code works now but this is how I'm done. Instead of using cli:
npx gltfjsx <path-to-my-.glb-file>
I uploaded the same .glb file to https://gltf.pmnd.rs/ and it generates the very similar code, and that code works. Comparing the two code, I found that in skinnedMesh generated by cli doesn't come up with ''name'' and other props
<skinnedMesh
geometry={nodes.EyeLeft.geometry}
material={materials.Wolf3D_Eye}
skeleton={nodes.EyeLeft.skeleton}
/>
The one generated by that website comes up with this:
<skinnedMesh
name="EyeLeft"
geometry={nodes.EyeLeft.geometry}
material={materials.Wolf3D_Eye}
skeleton={nodes.EyeLeft.skeleton}
morphTargetDictionary={nodes.EyeLeft.morphTargetDictionary}
morphTargetInfluences={nodes.EyeLeft.morphTargetInfluences}
/>
I'm not sure but I think that's the case
This is my first day using gltfjsx and I got this error immediately. I haven't modified any code.
I'm using vanilla jsx.
How I use it
File paths are correct