pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.5k stars 293 forks source link

Particle's positions shifted #86

Closed Reine0017 closed 3 years ago

Reine0017 commented 3 years ago

I tried running both the js file (created after running npx gltfjsx) and the original glb model in react and the particles on the js file one has the wrong positions.

For the js one, I used import Model from "./Donut.js"

and for the glb one I used: function Model(props) { const { scene, materials } = useGLTF("donut.glb") return <primitive object={scene} />; }

Screenshot from 2021-05-15 19-34-55 Screenshot from 2021-05-15 19-35-27

drcmda commented 3 years ago

could you try upping the precision a little? it cuts numbers off at two digits, depending on the models size that could be too little. if it still doesnt work you could upload the model and i take a look.

Reine0017 commented 3 years ago

Oh right, my model size is pretty small. I'll try to see if I can scale it up, thanks for the advice! I'll close this for now :)

drcmda commented 3 years ago

I meant the precision argument in gltfjsx 🙂 s one models are too small for the defaults but when you give it more precision day 4 or 6 it should be ok

Reine0017 commented 3 years ago

I meant the precision argument in gltfjsx s one models are too small for the defaults but when you give it more precision day 4 or 6 it should be ok

Hey @drcmda, thanks a lot for this :) It's working now!