sable

Members
  • Content Count

    88
  • Joined

  • Last visited


Reputation Activity

  1. Thanks
    sable reacted to NasimiAsl in TYPESCRIPT in Playground   
  2. Thanks
    sable got a reaction from klaude in alphaIndex occurs depth problem.   
    Actually pretty sure it's your sort function, needs to return a  -ve number, +ve number, or 0, not true or false. https://www.babylonjs-playground.com/#BTU1J7#5
    If you log out the position.z of each mesh after sorting the way it was you'll see that they're not in the correct order.
    It would be less work just using the pos.z - campos directly as the alpha index though, unless there is some other reason you need to sort them.
  3. Like
    sable got a reaction from fdeng in Babylon shows a different result   
    The model might be right handed. You could try:
    scene.useRightHandedSystem = true;  
  4. Like
    sable got a reaction from alexoy in Hide a sprite   
    Looks like lines 252 and 257 need to be adjusted to take into account sprites that have been made invisible.
  5. Like
    sable reacted to heyzxz in PCOL: billiards game made with babylonjs   
    Hi Everyone,
    I recently launched a preview version of my game made with BJS, and you can try it here.
    It's a 3d  billiards game, but currently only Snooker available in this preview version. 
    Hope you'll like it, and have fun. 
     
    It currently supports these browsers on desktop: Firefox, Chrome, Safari and Edge.
     
    (To BJS team: I have added a "powered by babylon.js" in the 'about' page of the game, please let me know if it is allowed to use your logo, and if I have used the right logo, since I just grabbed it from your home page, and converted to png.)
     

  6. Like
    sable reacted to trevordev in Hide a sprite   
    Sorry, I think it should be good now. PR: https://github.com/BabylonJS/Babylon.js/pull/4483 .  Thanks for the tip @sable
  7. Like
    sable got a reaction from trevordev in Hide a sprite   
    Looks like lines 252 and 257 need to be adjusted to take into account sprites that have been made invisible.
  8. Like
    sable got a reaction from Arte in Unable to get mesh on click event   
    Hi @Varsha Kamble
    I became far too interested in how to go about implementing this, and ended up making an improved pg based on your one above:
    https://www.babylonjs-playground.com/#Q2QLYZ#4
    I changed the dragging implementation to use mathematical planes as projection targets (as opposed to just mesh picking). This has the advantage of not needing the pointer to always be above a mesh when dragging, and also means that all three axis should get a nice 1:1 mouse movement to screen movement in the given axis direction.
    Hope the above is useful and/or interesting to someone. 
     
  9. Thanks
    sable got a reaction from Varsha Kamble in Unable to get mesh on click event   
    Hi @Varsha Kamble
    I became far too interested in how to go about implementing this, and ended up making an improved pg based on your one above:
    https://www.babylonjs-playground.com/#Q2QLYZ#4
    I changed the dragging implementation to use mathematical planes as projection targets (as opposed to just mesh picking). This has the advantage of not needing the pointer to always be above a mesh when dragging, and also means that all three axis should get a nice 1:1 mouse movement to screen movement in the given axis direction.
    Hope the above is useful and/or interesting to someone. 
     
  10. Thanks
    sable reacted to Wingnut in Unable to get mesh on click event   
    VERY nice, @sable!!!  Wow!  You're a GOD!  Sweet!
    Myself and a friend once made a "tri-plane dragger", but you did the same with mathematical planes... so no need for mesh-type planes!
    Spiffy!  Love it.  The only other use of a Babylon.Plane I have ever seen... is in mirrorTextures.
  11. Like
    sable got a reaction from Wingnut in Unable to get mesh on click event   
    Hi @Varsha Kamble
    I became far too interested in how to go about implementing this, and ended up making an improved pg based on your one above:
    https://www.babylonjs-playground.com/#Q2QLYZ#4
    I changed the dragging implementation to use mathematical planes as projection targets (as opposed to just mesh picking). This has the advantage of not needing the pointer to always be above a mesh when dragging, and also means that all three axis should get a nice 1:1 mouse movement to screen movement in the given axis direction.
    Hope the above is useful and/or interesting to someone. 
     
  12. Like
    sable got a reaction from Deltakosh in Label above the mesh   
    http://playground.babylonjs.com/#41IFI5#16
    See lines 134-144. Uses two methods suggested above; modifying linkedoffsetY each frame, or using an empty mesh parented to the desired mesh.
    What @Gijs suggested is basically what the GUI module is doing internally anyway, so is no heavier than relying on that.
    Regarding linkedOffsetY calculation each frame being too heavy, you're going to run into performance issues with projecting positions to screen space each frame long before performance of such a simple calculation is a concern.
  13. Like
    sable got a reaction from alexoy in Label above the mesh   
    http://playground.babylonjs.com/#41IFI5#16
    See lines 134-144. Uses two methods suggested above; modifying linkedoffsetY each frame, or using an empty mesh parented to the desired mesh.
    What @Gijs suggested is basically what the GUI module is doing internally anyway, so is no heavier than relying on that.
    Regarding linkedOffsetY calculation each frame being too heavy, you're going to run into performance issues with projecting positions to screen space each frame long before performance of such a simple calculation is a concern.
  14. Like
    sable reacted to trevordev in Sprites pick and pickup fired twice   
    Thanks sable. That does sound like a bug and your solution seems reasonable to me. I created a PR with this change here: https://github.com/BabylonJS/Babylon.js/pull/4191
  15. Like
    sable got a reaction from trevordev in Sprites pick and pickup fired twice   
    I've noticed that when using an action manager with sprites, both the OnPick and OnPickUp triggers are fired twice.
    This can be seen in the example (here), linked to from the documentation (here).
    Looking at the code, this seems to because scene._initClickEvent calls it's callback twice (here and here, cb being defined here). 
    This could be solved by checking if clickInfo.ignore is true before doing all the sprite checking, unless there is a good reason this wasn't done in the first place.
  16. Like
    sable reacted to Gijs in [solved] Sprite-picking, ignore transparent areas?   
    Hi, you can do this with BABYLON.WeirdSpriteManager:
    https://www.babylonjs-playground.com/#2A9U5V#1
    The manager has the function pickSpritePixel, which takes a child sprite as argument, and returns the pixel under the pointer. It does this by putting a plane mesh at the sprite position with the right rotation and scale, then pick that mesh to get the image (x, y) coordinates, and then get the pixel from the imageData like in your jsfiddle. It uses its own copy of the sprite image.
    Edit: Here is the typescript source:
    WeirdSpriteManager.ts
    Edit 2:
    With the mesh not pickable, and Math.round instead of Math.floor in the pickSpritePixel function:
    https://www.babylonjs-playground.com/#2A9U5V#2
    WeirdSpriteManager.ts
  17. Like
    sable reacted to mbarde in Stupax - Sidescroller game   
    Hi all,
    I would like to introduce Stupax: A different sidescroller game, where you are not the guy, you are the level!
    In fact you control a movable platform using the arrow keys or your gamepad (Gamepad API) to help the guy (namely Stupax) to get through the levels.
    You can play the game here: http://mbarde.bplaced.de/stupax/
    Controls:
    Arrow keys / Gamepad 'R' for level restart 'ESC' pause game and open menu Create and test your own levels here: http://mbarde.bplaced.de/stupax/editor.html
    You can find further information on my website and view the source code including contributions for the music, sounds and textures on GitHub.
     


  18. Like
    sable got a reaction from Snouto in ArcCamera wierdness   
    You should just be able to include it, and then add the touch-action attribute to the canvas (probably touch-action="none",  so that default actions aren't fired).
    I think the readme of the github repo is the only resource I used when I started including pep in projects.
  19. Thanks
    sable reacted to Deltakosh in Diffuse colour with Chrome Canary & FF Dev Edition (Angle?)   
    Yep I filed it
  20. Thanks
    sable reacted to Vorion in Instanced meshes with ShaderMaterial are not drawn   
    @sable and anyone who's interested in this:
    A friend of mine fixed got it fixed. Define instances was missing, and the "gl_position" matrix multiplication was in the wrong order.
    http://www.babylonjs-playground.com/#QNFL1G#4
  21. Like
    sable reacted to Deltakosh in Asset Manager texture task 404 doesn't call error fn   
    Good catch
    Will fix it with next commit (in one hour or so)
  22. Like
    sable got a reaction from Spankied in Babylon mouse control   
    I'm not entirely sure if this is what you want, but the following pg has one end of the line following the pointer.
    https://www.babylonjs-playground.com/#03QEFL
  23. Like
    sable got a reaction from Elijah in Propagating mousewheel event to parent?   
    Hi there. Just did a similar test to Wingy, and looks like babylon doesn't block the events, http://www.babylonjs-playground.com/#C3ZPAS.
    Looking at your page source, I think the issue is that the scene is embedded in an iframe. You should be able to send the event (or a message) from the iframe to the parent either via window.parent or window.Postmessage
  24. Thanks
    sable got a reaction from Samuel Girardin in New Physics Engine Progress   
    On an i7 3770k:
    Chrome 61: 8783ms for asm 8326ms for wasm FF 57 (dev edition): 7769ms for asm 7611ms for wasm The frame time (top right corner) sits at 12-13ms for wasm, but 16-17ms for asm after the test is finished.
  25. Like
    sable reacted to Samuel Girardin in New Physics Engine Progress   
    Hi, 
    Few news about energyJS, It's still in dev. Here is a quick very alpha  preview with examples. This is not a bjs plugin version. @RaananW worked one year ago on the plugin. We need to talk about that, For the moment it reproduces more the c inteface of ODE c++ project(http:// www.ode.org). It's quite usefull, ODE documentation is really good, and I kept all the method name.  Energyjs is port of Open dynamic engine to JS with EMSscripten (http://kripken.github.io/emscripten-site/) . 
    Tuto1_friction
    Tuto2_friction2
    Tuto3_bounce
    Tuto4_rolling_friction
    Tuto5_rolling_friction2
    Tuto6_contact_cfm_erp
    Tuto7_contact_cfm_erp2
    Tuto8_motion
    Tuto1_auto_disable_body
    WoodMachine
    BallJoint
    Trimeshes
    Vehicle   (maybe you need to refresh the html page - loading is async and I forgot to fix that,, same for v+trailers)
    Vehicle+trailers (arrow key to control the vehicle, d to flip the vehicle)
     
    It's only cpu dependent, maybe a little more faster than oimo and canon. Really well documented on ODE's part. You may have a TOTAL_MEMORY bug, search '167108864' in js/energy.js and increased this value.  This is just a start. I will publish this week the the typescript dev commented on github .