my problem is that I need to import a mesh, but for importing them, I need to get it from an API REST stub made with mockoon, who just have 2 root who each of them return a 3d modele(.glb) so for import them I tried with :
BABYLON.SceneLoader.ImportMesh(“”, “http://localhost:3001/”, “lamp”, scene, function (newMeshes) {
but it return this error : importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse
I really dont know how import meshes by this way
ok, but how do I do that?
because my API stub returns the file directly the file .glb as the address http://localhost:3001/lamp so how where do I force the extension and do I need to specify that the address returns a file that is not local but on a server?
thanks, it’s work perfectly on pc, but when I launch it on my phone, connected with a cable to my pc, the phone dont access to the api, whereas the address is localhost
If you are on the same network you could access the the app by using your IP address of your PC
So something like 192.168.0.xx:3001/lamp (check out what is your IPv4 address (on windows you can open console and call “ipconfig” and read the address) or on mac you go to “system preferences/network” and read the IP address.