joeBImagine

Members
  • Content Count

    30
  • Joined

  • Last visited

About joeBImagine

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. joeBImagine

    Screenshot adding a callback to a callback

    Come to think of it, you are right. I tried that before, but I wasn't implementing it correctly it would seem. let img = new Image(); img.onload = function () { alert("image is loaded"); } img.src = src;
  2. joeBImagine

    Screenshot adding a callback to a callback

    Aww yes! Something similar to a DOM image.onload callback. But mainly for when it is fully made, so that I can update my react toolbar
  3. Hello Babylon community!! I have a query concerning implementing a callback in a callback for taking a screenshot of cameras. I have this function call createCameraView: function (camera) { let src; BABYLON.Tools.CreateScreenshot(engine, camera, { width: 293, height: 150 }, function (data) { src = data; }); return src; }, the callback function actually saves out the image for each camera (including the hidden on's) in the scene as a base64 to the images src tag, but that saving part takes time. The part that I am confused about is actually setting up a callback for the callback, that lets me know when the image itself is done rendering. I am sorry I do not have a playground as most of this code is internal. And also please forgive me if this is not enough information to understand my issue. Cheers!
  4. joeBImagine

    Something missing in the Sky Material

    @Deltakosh wow so disappointed in myself right now, I did not . I took the doc as gospel and didn't think to add that. How do you all make it look so easy?! and thank you!
  5. I am under the suspicion that there is something I am missing in the Sky material. I am able to use the sky material in the playground as depicted in this link: https://www.babylonjs-playground.com/#ZU3JQZ#5 I also followed this doc link to the T: https://doc.babylonjs.com/extensions/sky However when I download the code, and run it on a local server, it is nothing but a blank screen. Any thoughts?
  6. @brianzinn thank you for that, looks like I was doing it wrong. But I did with your last tidbit and some tweaking, get it to work properly: //CREATE THE HIGHLIGHT LAYER let h1 = new BABYLON.HighlightLayer('hl', scene); //SET THE INITIAL STATE OF THE lastClickedMesh var let lastClickedMesh = null; let mesh = null; //ADD A POINTERDOWN OBSERVABLE scene.onPointerObservable.add(evt => { if (evt.pickInfo.hit && evt.pickInfo.pickedMesh !== undefined) { //STORES THE MESH INTO A VARIABLE mesh = evt.pickInfo.pickedMesh; let fabrics = document.querySelectorAll('.fabrics'); let currentFabric; fabrics.forEach(function(fabric) { fabric.addEventListener('click', evt => { console.log(obj[evt.target.id]); currentFabric = obj[evt.target.id]; if(mesh && currentFabric){ mesh.material = currentFabric; //console.log(evt.pickInfo.pickedMeshmesh); }else { mesh.removeMesh(mesh); } }); }); //HIGHLIGHTS THE CURRENT SELECTION if (newMeshes) { if (lastClickedMesh !== null) { h1.removeMesh(lastClickedMesh); } lastClickedMesh = mesh; h1.addMesh(lastClickedMesh, BABYLON.Color3.FromHexString('#4c90ef')); } } else { h1.removeMesh(lastClickedMesh); } }, BABYLON.PointerEventTypes.POINTERDOWN); } ); I can't emphasize enough how awesome this community is :D!!
  7. I think I understand what you are saying. change my window.addEventListener ('canvas') to this: canvas.addEventListener('pointerdown', () =>{ }
  8. @Arte @brianzinn Forgive the delay in a response!! So I've set the selectedMesh as a global variable above my main function. But still not able to change textures. I think it may be something to do with the window.addEventListener(canvas,..) as now I am not able to generate console.log reports when I select the mesh but I am not certain with my limited knowledge. Updated github.
  9. Thank you for the suggestions @brianzinn. If I am understanding correctly you are saying this correct: window.addEventListener(canvas, () => { const pickResult = scene.pick(scene.pointerX, scene.pointerY); console.log(pickResult.hit); let selectedMesh = null; if (pickResult.hit === true) { selectedMesh = pickResult.pickedMesh; if (selectedMesh && currentFabric) { selectedMesh.material = currentFabric; } } console.log(selectedMesh); console.log(currentFabric, 'currentMesh'); }); If I am inputting that correctly, the texture change no longer works.
  10. @JohnK You know what, you are right. It works on my ipad correctly as well. Never thought to try that. However on desktop , in both chrome and edge the issue persists.
  11. Hello Babylon community!! I am having an issue that I am not sure how to resolve. Here is my github.io to get a better sense of the problem: https://jbimagine.github.io/# In the link above I have a babylon file loaded, and in the side ui (if you click on the gear icon) several texture HTML DOM elements. What I am trying to do is when you click on the mesh, then click on the texture swatch in the ui, the texture on the mesh will change. For some reason however, it is not working correctly. I click on the mesh, then click on the swatch, then have to click back on the mesh for the texture to actually change. Note that I am not using the set name of the mesh, but rather a const created from the pick.result so that it will be based off of any loaded mesh. Any help on what I am missing (probably something stupid easy) would be awesome! Also I am curious if it would have been easier, and more efficient to use the gui?
  12. @Wingnut you asked what am I working on!! So I will share in the wingnut chronicles!! I am currently working on a babylon prop loader and texture changer. As I love 3d, and have had a desire to get better with my javascript (and a desire to move to the web team ), I thought learning babylon and Javascript at the same time would be an awesome endeavor. Couldn't do it without this awesome community however. As they say sharing is caring, so my source code is here: https://github.com/jbimagine/Babylon1 and a live demo here: jbimagine.github.io. It is still very much a work in process, and extremely rough around the edges.
  13. @Wingnut that is good to know! And I finally figured out how to mark the thread solved hahaha!! I will let you know what I am working on over at the Wingnut Chronicles!!
  14. joeBImagine

    Babylon exporter for Maya ?

    @dsman would exporting from maya to blender work as an interim solution? As they have a Babylon exporter for blender.
  15. @Wingnut you are awesome thank you!! You all make it look so easy!!