naver / egjs-view3d

Fast & customizable 3D model viewer for everyone
https://naver.github.io/egjs-view3d
MIT License
199 stars 30 forks source link

Mesh number is different on Android and iOS #5

Closed velickolb closed 2 years ago

velickolb commented 3 years ago

I'm having strange issue with toggling visibility of meshes on the imported model. I'm toggling mesh visibility with view3d.model.meshes[1].visible = false; and when I open app on Android and on iOS phone different mesh is hidden. I solved it by checking on what platform app is running and based on that I toggle different meshes but I'm sure that there has to be way to do it without checking platform.

WoodNeck commented 3 years ago

Hello, @velickolb! That's weird, can I have a copy of that 3D model to test it?

velickolb commented 3 years ago

Here is the model. https://drive.google.com/file/d/1l5AlIPmmKGeGRWhOc1Y-fhzTyiiID434/view?usp=sharing

WoodNeck commented 3 years ago

@velickolb Sorry for the long wait I've just tested your model in 4 environments: Windows, Mac, Android, iOS and it all showed the same result. Looks like your model has meshes named "a", "b", "c" and View3D's returned meshes are ordered in "c", "a", "b" Can you share me some more details?

Test Code


const view3d = new View3D("#view3d-canvas");
const loader = new View3D.GLTFLoader();

loader.load("../asset/female.gltf") .then(model => { console.log(model); view3d.display(model); document.querySelector("#result").innerHTML = model.meshes.map(mesh => mesh.name).join(", "); });



These are the test results:

> Windows (Chrome)
![image](https://user-images.githubusercontent.com/26213435/120614608-62653000-c492-11eb-8d32-e28dfb71ae75.png)

> Mac (Chrome)
![image](https://user-images.githubusercontent.com/26213435/120615359-2a122180-c493-11eb-8c69-45c300f7714b.png)

> Android (Chrome, Android 9)
![Screenshot_20210603-174222](https://user-images.githubusercontent.com/26213435/120615387-326a5c80-c493-11eb-84b9-919db827af9d.png)

> iOS (Safari, 14.4.2)
![image](https://user-images.githubusercontent.com/26213435/120615421-3ac29780-c493-11eb-86cf-30bf9795da5e.png)