i am trying around a bit with babylonjs and some 3d data. i have a terrain as an stl file and a raster (jpg) that i want to use as texture. i got it working with creategroundfromheight map and the raster on top, but for some reason it doesnt work with my stl file.
Would be glad if someone has a hint, i search around and tried other ways and the mesh also doesnt take any color. I ended up with stl, because the other fileformats (glb, gltf…) didnt show up, as seen in the playgroundcode.
The reason is that your assets are blocked by CORS policy. It is easy to see if you would open the console (it is always useful in case of any errors ).
Hey, thank you for the welcome ,
i have to say im struggeling with this cors in general. it didnt show me this issue before, but maybe cos i was connected the server the raster is saved.
anyway i uploaded everything on dropbox now and console aint showing me any cors issues, but still i dont see the raster on that stl.
There are several errors in your PG.
First, if you use ImportMeshAsync() you need to use await as well.
Second, when you import your model, it is imported as Object.
But @Deltakosh was faster than me with the corrected Playground
Thank you everyone for the answers, after I started defining the UV Coordinates in DCC and didn’t really get forward I changed to glb and changed some things there, which made it way easier to get my meshes displayed. Since there where actually three right answers but can only mark one as solution and I guess the first one already solved my asked question I will mark that