Jump to content

aWeirdo

Members
  • Content Count

    653
  • Joined

  • Last visited

  • Days Won

    9

Reputation Activity

  1. Thanks
    aWeirdo got a reaction from Nikola Lukic in Youtube video as a Source for Video Texture   
    Hi @Raghavender Mylagary 

    Youtube video source's are not publicly available.
    There's a good reason for this, which is that these videos are made by people or companies who hold the copyright's to them, they are released to be available on youtube, and youtube only.
  2. Like
    aWeirdo got a reaction from Wingnut in Please Help with this...   
    Hi again, @i_tejas19
    Afraid I don't use blender, ( do you have a .babylon file ? ), but I suggest adding it after import  

    Here's an example: 
    https://www.babylonjs-playground.com/#XCPP9Y#751
    Side-note, this one only uses a single ActionManager  
    Short snippet: 
    var labelActionManager = new BABYLON.ActionManager(scene); labelActionManager.registerAction( pointerOverAction); labelActionManager.registerAction( pointerOutAction); function addLabelToMesh(mesh) { if(mesh.name){ // Do some check if we should add label to this mesh.. mesh.actionManager = labelActionManager; } } // Meshes BABYLON.SceneLoader.ImportMesh("Rabbit", "/scenes/", "Rabbit.babylon", scene, function (newMeshes, particleSystems, skeletons) { // Rabbit.babylon only contains a single mesh. // Simulate the file has multiple meshes, scale & position them. newMeshes[1].scaling = new BABYLON.Vector3(0.1, 0.1, 0.1); newMeshes[1].name = null; // Don't add label for rabbit 1, purely for demostration. var meshes = []; meshes[0] = newMeshes[1]; meshes.push(meshes[0].clone("rabbit 2"), meshes[0].clone("rabbit 3")) meshes[1].position = new BABYLON.Vector3(-5, 0, -2); meshes[2].position = new BABYLON.Vector3(5, 0, -2); // (Attempt to) Add label for each mesh in 'meshes'. meshes.forEach( addLabelToMesh); });
    Off-topic:
    Thanks!
    Yes, Battleplanes is purely made with babylonJs, 
    It's just a small side-project i work on once in a while, still far far from finished  
  3. Like
    aWeirdo got a reaction from i_tejas19 in Please Help with this...   
    Hi again, @i_tejas19
    Afraid I don't use blender, ( do you have a .babylon file ? ), but I suggest adding it after import  

    Here's an example: 
    https://www.babylonjs-playground.com/#XCPP9Y#751
    Side-note, this one only uses a single ActionManager  
    Short snippet: 
    var labelActionManager = new BABYLON.ActionManager(scene); labelActionManager.registerAction( pointerOverAction); labelActionManager.registerAction( pointerOutAction); function addLabelToMesh(mesh) { if(mesh.name){ // Do some check if we should add label to this mesh.. mesh.actionManager = labelActionManager; } } // Meshes BABYLON.SceneLoader.ImportMesh("Rabbit", "/scenes/", "Rabbit.babylon", scene, function (newMeshes, particleSystems, skeletons) { // Rabbit.babylon only contains a single mesh. // Simulate the file has multiple meshes, scale & position them. newMeshes[1].scaling = new BABYLON.Vector3(0.1, 0.1, 0.1); newMeshes[1].name = null; // Don't add label for rabbit 1, purely for demostration. var meshes = []; meshes[0] = newMeshes[1]; meshes.push(meshes[0].clone("rabbit 2"), meshes[0].clone("rabbit 3")) meshes[1].position = new BABYLON.Vector3(-5, 0, -2); meshes[2].position = new BABYLON.Vector3(5, 0, -2); // (Attempt to) Add label for each mesh in 'meshes'. meshes.forEach( addLabelToMesh); });
    Off-topic:
    Thanks!
    Yes, Battleplanes is purely made with babylonJs, 
    It's just a small side-project i work on once in a while, still far far from finished  
  4. Like
    aWeirdo got a reaction from i_tejas19 in Please Help with this...   
    Here's the same one Wingnut posted, but re-using the same rectangle & textblock  
    https://www.babylonjs-playground.com/#XCPP9Y#748

    -- Edit --
    Another one with a few more optimations, generic displayRect1 function, using the mesh's name or id as text source as example and re-using babylon actions aswell. 
    https://www.babylonjs-playground.com/#XCPP9Y#750
  5. Like
    aWeirdo got a reaction from Wingnut in Please Help with this...   
    Here's the same one Wingnut posted, but re-using the same rectangle & textblock  
    https://www.babylonjs-playground.com/#XCPP9Y#748

    -- Edit --
    Another one with a few more optimations, generic displayRect1 function, using the mesh's name or id as text source as example and re-using babylon actions aswell. 
    https://www.babylonjs-playground.com/#XCPP9Y#750
  6. Like
    aWeirdo reacted to Wingnut in Please Help with this...   
    Hi @i_tejas19, welcome to the forum.  Congrats on successful BJS scene/animations!
    Pop-up mouse-over labels, eh?  Here, check this out...
    https://www.babylonjs-playground.com/#XCPP9Y#447
    That playground teaches BabylonJS GUI labels... AND BJS ActionManager onPointerOverTrigger.  Keep in mind that an entire PANEL of information... can pop-up, with clickable stuff on that panel.  WOW!
    I found that playground... using a playground search.  I happen to know that MOST GUI demos have the term "advancedTexture" in them... from experience.  I often re-name my GUI demo vars to 'adt' - short for advancedDynamicTexture.  AdvancedDynamicTexture is a basis for BabylonJS GUI "stuff"... sort of like a sheet of glass that can be put atop a mesh, or across entire screen.  Then we paint GUI "controls" onto that glass.
    That playground will get you started.  Both BJS GUI and BJS ActionManagers... are very powerful and versatile.  Take the time to read/experiment.  Look at the demos/playgrounds in the docs... they inspire more ideas.  Soon you will be expert.
    Ask more, if needed.  Make a playground to show us stuff, if you wish.  We'll be here. 
    If solved, mark this thread solved, please.
  7. Like
    aWeirdo got a reaction from Sebavan in Cloning advanced meshes & their skeletons outside loader   
    Update:
    After taking a break from it, 
    i came back with a clear head and started debugging it,
    I figured out what was going on and created a function which supports complete cloning in multiple cases of complex models & their skeleton(s).
    The mentioned issue was a missing link, due to the way i handle the skeletons, in the dude's case, the cloned children's .skeleton variable was undefined.
    The function supports the following cases;
    Single mesh & single skeleton. 
    Invisible parent with multiple children & single skeleton. //Same skeleton for all children.
    invisible parent with multiple children & multiple skeletons //One seperate skeleton for each child.
     
    Feel free to use it as you wish, 
    PG: http://www.babylonjs-playground.com/#1EL5BE#21
  8. Like
    aWeirdo got a reaction from eps in Cloning advanced meshes & their skeletons outside loader   
    Update:
    After taking a break from it, 
    i came back with a clear head and started debugging it,
    I figured out what was going on and created a function which supports complete cloning in multiple cases of complex models & their skeleton(s).
    The mentioned issue was a missing link, due to the way i handle the skeletons, in the dude's case, the cloned children's .skeleton variable was undefined.
    The function supports the following cases;
    Single mesh & single skeleton. 
    Invisible parent with multiple children & single skeleton. //Same skeleton for all children.
    invisible parent with multiple children & multiple skeletons //One seperate skeleton for each child.
     
    Feel free to use it as you wish, 
    PG: http://www.babylonjs-playground.com/#1EL5BE#21
  9. Like
    aWeirdo got a reaction from DylanD in Can't import babylonjs-gui?   
    Hi, please read the error again.
     
    it's not "addControl" which is undefined, it's "advancedTexture" which hasn't been created.
     
  10. Like
    aWeirdo got a reaction from NasimiAsl in loading screen with a video   
    Here's one in HTML that just makes a black background container and a video element.
    https://playground.babylonjs.com/#GC1S7W#1 (You may need to click run before the video works, issue with video elements need interaction.)
    side-note: PG with timeout( for extra video time ) will bug when clicking run again before the timeout finishes (and video is hidden).
  11. Like
    aWeirdo got a reaction from Buzul in loading screen with a video   
    Here's one in HTML that just makes a black background container and a video element.
    https://playground.babylonjs.com/#GC1S7W#1 (You may need to click run before the video works, issue with video elements need interaction.)
    side-note: PG with timeout( for extra video time ) will bug when clicking run again before the timeout finishes (and video is hidden).
  12. Like
    aWeirdo got a reaction from kcoley in loading screen with a video   
    Here's one in HTML that just makes a black background container and a video element.
    https://playground.babylonjs.com/#GC1S7W#1 (You may need to click run before the video works, issue with video elements need interaction.)
    side-note: PG with timeout( for extra video time ) will bug when clicking run again before the timeout finishes (and video is hidden).
  13. Like
    aWeirdo got a reaction from Deltakosh in loading screen with a video   
    Here's one in HTML that just makes a black background container and a video element.
    https://playground.babylonjs.com/#GC1S7W#1 (You may need to click run before the video works, issue with video elements need interaction.)
    side-note: PG with timeout( for extra video time ) will bug when clicking run again before the timeout finishes (and video is hidden).
  14. Like
    aWeirdo got a reaction from mind0n in Maximum call stack size exceeded when apply click event on BILLBOARDMODE_ALL enabled meshes   
    Hi  
    Deltakosh should be around by tomorrow.
    As mentioned, this happens because of a loop in calls,
    Here's a temporary fix for until it's fixed;
    Accessing absolutePosition directly, instead of getAbsolutePosition() function which forces computeWorldMatrix.
    Include the snippet in your code, after the main babylonJs file.
    BABYLON.ArcRotateCamera.prototype._getTargetPosition = function() { if (this._targetHost && this._targetHost.absolutePosition) { var e = this._targetHost.absolutePosition; this._targetBoundingCenter ? e.addToRef(this._targetBoundingCenter, this._target) : this._target.copyFrom(e) } var t = this._getLockedTargetPosition(); return t || this._target } https://www.babylonjs-playground.com/#9XBPW4#4
  15. Like
    aWeirdo got a reaction from ssaket in Maximum call stack size exceeded when apply click event on BILLBOARDMODE_ALL enabled meshes   
    Hi  
    Deltakosh should be around by tomorrow.
    As mentioned, this happens because of a loop in calls,
    Here's a temporary fix for until it's fixed;
    Accessing absolutePosition directly, instead of getAbsolutePosition() function which forces computeWorldMatrix.
    Include the snippet in your code, after the main babylonJs file.
    BABYLON.ArcRotateCamera.prototype._getTargetPosition = function() { if (this._targetHost && this._targetHost.absolutePosition) { var e = this._targetHost.absolutePosition; this._targetBoundingCenter ? e.addToRef(this._targetBoundingCenter, this._target) : this._target.copyFrom(e) } var t = this._getLockedTargetPosition(); return t || this._target } https://www.babylonjs-playground.com/#9XBPW4#4
  16. Like
    aWeirdo got a reaction from Wingnut in Possible Playground FragID issue   
    I can confirm,
    1'st save-> #
    accessing #1 fails

    2'nd save -> #1
    accessing #2 works
    3'rd save -> #3
    accessing #4 works
     
    I can't see any changes to the save code, so perhaps something changed on the server.
  17. Like
    aWeirdo reacted to Deltakosh in Pointerup observable bug ?   
    Yes this is still the same issue I try to fix since ages
     
    Hopefully it should be good now on the latest nightly
  18. Haha
    aWeirdo got a reaction from Mark Bufton in Back to my teenage years   
    LSD years, John? 😂
  19. Haha
    aWeirdo got a reaction from hcmetal in Back to my teenage years   
    LSD years, John? 😂
  20. Haha
    aWeirdo got a reaction from JohnK in Back to my teenage years   
    LSD years, John? 😂
  21. Like
    aWeirdo reacted to JohnK in Back to my teenage years   
    https://www.babylonjs-playground.com/#S7HM64#4
  22. Like
    aWeirdo got a reaction from ssaket in [PG] Code Hot Swapping experiment   
    Code "hot swapping" / auto-update experiment for babylon playground..
    Discussion: 
     
     
    What does it do?
    Change a property in the editor like light.intensity from '1' to '.5' and see the results without having to click run and resetting the scene.

    Current Rev: http://playground.babylonjs.com/#TY8HCN#7

    Bugs are expected.  
  23. Like
    aWeirdo reacted to brianzinn in How to achieve Hot Code Replacement (without Browser reload)?   
    In case anybody is wondering what hot reloading textures looks like, I have made a screen capture.  This saves you the trouble of downloading @Nodragem's repo, adding that one line patch and running it yourself, even though that only takes a few minutes   Chrome on top, Edge on the bottom - on the right dragging a different image up into our webserver /assets/ directory and having it hot reloaded into WebGL + BabylonJS.
    The huge advantage with this technique (over the HMR you see in my screen capture above) is that we are replacing a running instance (not reloading cameras, lights, other assets, etc.) and this is where you want to be if you are ie: making a game, whereas my first screen capture (while it does use HMR) is rebuilding the entire scene.  Some advantages of scene rebuilding is that I can add/remove to scene, replay state (in my game, I can fully restore from state on startup) and change things like constructor variables and have them take effect, etc.
    @Deltakosh - Reporting back.  I am about to start digging through the engine cache texturing to see if that is how we could/should be replacing textures for entire scene.

  24. Like
    aWeirdo got a reaction from Wingnut in Drop down button   
    Hi @Mekaboo
    http://playground.babylonjs.com/#41IFI5#18

    You must include the dropdown constructor;
    var Dropdown = (function () { function Dropdown(advancedTexture, height, width, color, background) { // Members this.height = height; this.width = width; this.color = color || "black"; this.background = background || "white"; this.advancedTexture = advancedTexture; // Container this.container = new BABYLON.GUI.Container(); this.container.width = this.width; this.container.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; this.container.isHitTestVisible = false; // Primary button this.button = BABYLON.GUI.Button.CreateSimpleButton(null, "Please Select"); this.button.height = this.height; this.button.background = this.background; this.button.color = this.color; this.button.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; // Options panel this.options = new BABYLON.GUI.StackPanel(); this.options.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP; this.options.top = this.height; this.options.isVisible = false; this.options.isVertical = true; var _this = this; this.button.onPointerUpObservable.add(function() { _this.options.isVisible = !_this.options.isVisible; }); //custom hack to make dropdown visible; this.container.onPointerEnterObservable.add(function(){ _this.container.zIndex = 555; //some big value }); this.container.onPointerOutObservable.add(function(){ _this.container.zIndex = 0; //back to original }); // add controls this.advancedTexture.addControl(this.container); this.container.addControl(this.button); this.container.addControl(this.options); // Selection this.selected = null; this.selectedValue = null; } Object.defineProperty(Dropdown.prototype, 'top', { get: function() { return this.container.top; }, set : function(value) { this.container.top = value; }, enumerable: true, configurable: true }); Object.defineProperty(Dropdown.prototype, 'left', { get: function() { return this.container.left; }, set : function(value) { this.container.left = value; }, enumerable: true, configurable: true }); Dropdown.prototype.addOption = function(value, text, color, background){ var _this = this; var button = BABYLON.GUI.Button.CreateSimpleButton(text, text); button.height = _this.height; button.paddingTop = "-1px"; button.background = background || _this.background; button.color = color || _this.color; button.onPointerUpObservable.add(function() { _this.options.isVisible = false; _this.button.children[0].text = text; _this.selected = button; _this.selectedValue = value; }); this.options.addControl(button); }; return Dropdown; }());  
  25. Like
    aWeirdo reacted to Deltakosh in Babylon.js v3.3 is out!!!!   
    We did it guys!!!
    Let's share the love: 
     
     
    Feel free to retweet as much as you can!!!
     
×
×
  • Create New...