Open prolove15 opened 3 months ago
Hi do you try with native three loader ? is maybe a problem's on your model what exporter you use ? what compression ? i only include the draco compression in phy.
you can use the loader of three if is work and use your model in phy.
Thank you for your kind support. Regarding the model compression, I tested it using museum models in phy repository But the error was same
When I use ThreeJS's default loader, there wasn't any problem Could you write the code how to use model that loaded through ThreeJS's default loader in phy?
you can use any model you want in phy i use pool only to manage demo switch and don't reload model. You have to take care of your model name and not use too complex mesh on simulation
phy.load(['./assets/models/chess.glb', './assets/models/chessclock.glb'], onComplete )
onComplete = () => {
// get a object with list of model
const clockMesh = phy.getMesh('chessclock');
// add a box shape and remplace by the model. here is clockMesh.clock
phy.add({ type:'box', size:[3,1.6,1.1], pos:[0, 0.8-0.02, -5.2], mass:1, mesh:clockMesh.clock, material:'Clock' })
}
don't set material:'Clock' if you want keep original material of your model
I am making a web app using ThreeJS and React It's very similar with the museum example of phy I implemented almost of functionalities using Phy However I encountered in issue to load custom museum model
phy.load( 'dices.glb', onComplete )
phy.load( ['dices.glb', 'yo.jpg'], onComplete )
This code are wrotten at the Phy engine guide https://lo-th.github.io/phy/docs/index.html#manual/phy-load
But this code doesn't works in my project
I will share my main code: