focomoso

Members
  • Content Count

    59
  • Joined

  • Last visited

About focomoso

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    newmatter.com

Profile Information

  • Gender
    Male
  • Location
    Los Angeles, CA

Recent Profile Visitors

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

  1. focomoso

    GUI - Automatically measuring TextBlock size

    Did this make it into the stable version? I'm trying to use getRawFontSize() in v3.2.0-alpha10, but it's throwing an error. Or is there another way to get the actual width of GUI text?
  2. focomoso

    GUI TextBlock flick on addControl

    Thanks guys. This is one of the reasons why Babylon is such a great solution. The community is so active. Proactive, even...
  3. Hi, I'm trying to evaluate Babylon for use as a 2d charting engine. So far so good, but one of the things we'll need to be able to do is add and remove text labels on the fly. I have a tiny demo here: https://www.babylonjs-playground.com/#WRD1S9#6 Notice how the label flashes at the bottom right corner for a brief moment every time the label is added to the advanced texture and before it's linked to the mesh. First, is there a way around this? I've tried linking to the mesh before adding, but then the label doesn't actually link. Second, is there a better way to do this? I've tried setting the label.text = "" and it works, but the performance is not as good when we remove the labels entirely. Thanks for any help, James
  4. focomoso

    Better CSG?

    Also, the original csg.js file from OpenJSCad has moved here: https://github.com/jscad/csg.js/blob/master/csg.js
  5. focomoso

    Better CSG?

    I'm revisiting this as I have some time now. I'm just collecting a bunch of resources here so I (and hopefully others) can keep them handy: Overview of algorythms: https://github.com/openscad/openscad/wiki/Project%3A-Survey-of-CSG-algorithms c++ CSG (as a .wasm, perhaps): http://opencsg.org/ GPU based csg: https://www.researchgate.net/publication/220184001_Blister_GPU-based_rendering_of_Boolean_combinations_of_free-from_triangulated_shapes https://www.cc.gatech.edu/~jarek/papers/Blister.pdf https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwjS3OHi8NjYAhUCneAKHeYeBwQQFgg2MAE&url=https%3A%2F%2Fwww.cc.gatech.edu%2F~jarek%2Fcourses%2F1050%2Fslides%2FL18Blister.ppt&usg=AOvVaw0Umt9sHnc7eANjD1mr1Web
  6. focomoso

    engine.dispose() giving error on 3.1.0

    Strange... I went to do a pr to make this change myself and the version babylonjs@3.1.0-alpha3.6 already has this in, but when I get the package with npm, it's not there...
  7. focomoso

    engine.dispose() giving error on 3.1.0

    I did some more digging and it seems that the framework I'm using (React) cleans up the canvas while the dispose method is being called. All we need to fix this is to add an if (this._renderingCanvas) {} around the _renderCanvas.removeEventListener calls.
  8. I updated to 3.1.0-alpha3.6 and am now getting the error: "Uncaught TypeError: Cannot read property 'removeEventListener' of null" when I call engine.dispose(). The line in question is: this._renderingCanvas.removeEventListener("focus", this._onCanvasFocus); The canvas has been disposed of elsewhere and Edit: the canvas is still defined when the dispone() is called. I need to dispose of the context because this app opens and closes the gl canvas repeatedly and will evntually give a "Too many active WebGL contexts." warning. Is there a way to dispose of the context without calling .dispose()? Or is there a way to have the .dispose() method only try to remove listeners if the canvas is still defined? Thanks
  9. Also found this: https://stackoverflow.com/questions/35226272/taking-a-snapshot-of-babylonjs-scene-sometimes-works-sometimes-doesnt That suggests sending {preserveDrawingBuffer: true} as an option, but this isn't working either...
  10. I just want to chime in here and point out that I'm seeing the same issue. For some reason canvas.toDataURL() is returning a blank png image. @IIerpos Can you think of anything that may be causing this?
  11. I've done some digging and it seems that canvas.toDataURL() is the culprit. It's returning a blank png image. This isn't babylon.js's fault per se, but can anyone think why that might be happening? I get the same issue on chrome and firefox. Thanks
  12. Unfortunately seeing the same issue with 3.1.0-alpha3.6
  13. focomoso

    Rendering HTML in a Babylon scene?

    Completely off the top of my head, but you may want to look at rendering html into a canvas and then grabbing that image and applying it as a texture: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas
  14. It seems to work fine in the PG. Not sure what my app could be doing that's any different. Could the fact that I'm using 3.0.0 be an issue?
  15. Tools.CreateScreenshot is returning an entirely transparent image: CreateScreenshotUsingRenderTarget: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAARElEQVQoU2P8////fwYiAOMAKwwPD2cAORWEG/fuZah3dkZx9erVqxkYQ0JC/gsJCTG8e/cOw0uMjIxwsYH2DBHhzQAAK0005fzJ758AAAAASUVORK5CYII= CreateScreenshot: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAF0lEQVQoU2NkIBIwEqmOYVQh3pAiOngACmkAC5eMKzgAAAAASUVORK5CYII= Edit: I found this thread: but there seems not to be a resolution. Thanks