Dos

Members
  • Content Count

    13
  • Joined

  • Last visited

About Dos

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I feel so dumb. This is what I was missing! Thank you Deltakosh!
  2. Thank you for the advice. I like it the way it is now because the zip encapsulates all the assets I need avoiding possible 404 errors if one of these isn't findeable. Il talk to the 3D artists providing me glTFs about decimals. I really didn't thought about that but seeing how geometry adds weight, this seems like an efficient and easy way to optimize ! Thanks again, this is so enlightening for me
  3. Hi there, Following the docs, I added PEP on my project to support touch events (and polyfill Safari by the way). But I cannot manage to get the arcRotateCamera to properly react to touch events. When trying playground demos, it works as expected but on my project, the inputs seem to move a bit then stop responding. Sometimes it zooms in or out, sometimes it pans a little bit then stops. Am I missing something here ? This is how I init my camera : this.camera = new BABYLON.ArcRotateCamera( 'camera', 1.2, 1.3, 180, new BABYLON.Vector3(0, 40, 0), this.scene ) this.camera.attachControl(this.canvas, true) Is it possible I miss something obvious here ? PS: I also tried by removing any event listener just initing a scene in BJS with no success.
  4. Thank you very much for your help. In fact, we switched back to glTF instead of glb and zipped all the assets required by the model. For people landing here with a similar "issue", here's how I did this : zip the .gltf .bin and anything else you'd need like texture assets. I used JSZip to extract all assets. This lib offers a bunch of formats to extract files like 'string' and 'blob' (those were what I wanted) then extract the .gltf as a string and replace references to the assets by the extracted blobs and load the modified glTF simply with BABYLON.SceneLoader.ImportMeshAsync('', '', `data:${glTFasStringifiedJSON}`, scene) And voilĂ ! Bonus fact : The zipped glTF with assets turned out to be lighter than the zipped glb Thanks again for your help
  5. Thank you for your help. I'll try that too but is there any reason why we can't provide any asset directly instead of its path ? (BJS seems to obviously doing that under the hood so is there any shortcut to provide the glb content in the first place ?)
  6. Hey, I'm currently successfully loading glb files through the `BABYLON.SceneLoader.ImportMeshAsync('', rootURL, filename, scene)` method. I was wondering if (for loading times) it was possible to import meshes from a zip file containing the glb one. I could unzip and get the GLB file but, all I have is it's content but not its path. Is there a way to provide ImportMesh or ImportMeshAsync the content to load instead of its path ? Thanks in advance !
  7. Thank you very much JohnK (for the welcome message and the help) Looks like this is what I was searching for Just a little note about that for every dev landing on this question : don't forget to use PEP in order to have this working on Safari as it doesn't support pointer events yet
  8. Hello everybody, I'm currently trying to get a mesh by clicking on the canvas. So far, it works really great but I still have a problem: On click, the mesh gets highlighted. Fine but when I drag the mouse on the canvas in order to move the cam, when I release the button of the mouse, a click event is triggered and the mesh beneath it get selected. I tried to add an event listener on 'mouseup' to stop propagation to the click event but it seems BJS already "intercepts" this event so it is never triggered. I created a codepen to illustrate : https://codepen.io/3dos/pen/mLEEdq On the left is an empty canvas on which the mouse events are triggered. On the right is a babylon canvas on which the mouseup event is not triggered. Is there a simple way to avoid selecting meshes on drag ? (also tried the dragend event with no success either) Thanks to everybody who already helped me PS: I joined a screenshot of the console illustrating what I'm telling (did the exact same actions on the 2 canvas)
  9. OK, I finally found it. No need for deepmerge here (as it throws the error above probably because the material objects are too big to be processed that way) All I needed to do was : mesh.material = BABYLON.Material.Parse(material, this.scene) The UVs and normals aren't fine for now but the materials are loaded correctly !
  10. Do you have textures in your materials ? How do you apply them to a mesh ? I tried // material is the object from the json file and deepmerge a library I use mesh.material = deepmerge(mesh.material, material) But it throws a "RangeError: Maximum call stack size exceeded" :'(
  11. Hello everybody, I'm currently working on a project implying a serious amount of materials (including textures) and would like to store them as separate files (one per material). So, at first, I decided to store the "material" object as a json file including textures as base64 strings. I simply tried to merge the object from this json file onto the mesh.material with deepmerge resulting in a "RangeError: Maximum call stack size exceeded" (probably due to the base64 textures inside of it) So I was wondering : what would be the best way to store my materials as separate files so I could load them when needed? Sorry if this question looks stupid but I can't manage to find a suitable solution. Thanks in advance
  12. Oh, thank you Deltakosh! Sorry if my question looked dumb, I'm quite struggling with the doc actually
  13. Hi there, I started jesting around a few days ago on babylonJS and was wondering if it was possible to get the GLTF Loader with npm to import it as it is not in the babylonjs npm package. Thanks in advance for your help. Dos.