• Content Count

  • Joined

  • Last visited

Everything posted by AB95

  1. @Wingnut @Deltakosh @Raggar It works! thank you guys so much for the help!
  2. Hi, I am trying to make a goalkeeper game, which require goalkeeper mesh body to be able to "block" any football that hit toward him. The best would be the mesh collider that represent the goalkeeper to be reasonably precise while not being overkill, so I created boxes, set their physics imposter, and attach them to each bone. which look like this: http://www.babylonjs-playground.com/#SRR6Y2#1 however, I don't know how to make each box collidable to the falling sphere, did I miss anything, or does it require more complex way of implementation?
  3. Hi, sorry if this is a stupid question, for now is it possible to update a GUI Button's image after its creation? I created a button with function GUI.Button.CreateImageWithCenterTextButton(name,text,imageUrl), and I notice the third parameter is an image url, I checked with the documentation https://doc.babylonjs.com/how_to/gui but it does not mention any property name that I can use to set image url.
  4. Hi, I know this should not be BabylonJS issue, just intend to aware people that Lenovo Phab 2 Pro may have canvas rendering issue. I am using chome to open the webpage, while firefox and opera had no problem displaying the 3D scene. below are screenshots of webpage with webgl content: The Sponza Demo: www.babylonjs.com/demos/sponza/ The Espilit Demo: https://www.babylonjs.com/demos/espilit/ The Instances Demo: https://www.babylonjs.com/demos/instances/ And all ThreeJS projects I had viewed so far have this issue too: Lasertown: http://oletus.github.io/lasertown/ The Aviator: https://tympanus.net/Tutorials/TheAviator/ It looks like the major area of the canvas is covered, and leaving only a small rectangle area at the left bottom corner to be viewable, I am able to apply user input beyond the viewable rectangle area to navigate the scene(for example the Espilit demo). I had file an bug report to chrome and intend to file another one to lenovo as well.
  5. @Deltakosh the Sponza scene loads perfectly on the iphone 6 that previously having issue loading my page. And in fact, I just enable offline support by setting up the manifest file. And unexpectedly, after I did that, error's gone, I am able to enter the scene again, but I am uncertain about how reliable this is as it took me a few times of clear cache and reload to finally enter the scene. Also, regarding the offline support, may i ask, will clear cache also remove offline resource? Once I clear cache, do I have to change the version number in manifest file in order to download assets again? Thanks.
  6. hi @Deltakosh, the gzip compression is on, and after I convert .babylon file into .incremental.babylon file, same link: the first few time i am finally able to enter the scene using iphone 6 safari, but as I tested again for a few more times(every time I clear safari cache before open the webpage again), more errors shows out, an error similar as previous one shows up again: Error status: 0 - Unable to load fileRoot/myScene.someOfMySceneMeshName.babylonmeshdata I am surprise as there are some of the .babylonmeshdata that have this error which are actually quick small in size. also there is a new error: Cross-origin image load denied by Cross-Origin Resource Sharing policy. I am not familiar with server side knowledge, but since the scene is not hosted locally, I wonder why cross-origin error still occurs... Also this times of using incremental babylon file, these error occurs on almost all iphone (5, 6, 6s as i asked friend to help me test), previously when I use non incremental babylon file to import mesh into the scene, iphone 6s seems to have no issue, although it could be iOS having a good day and decide to have a success loading on some of the iphone brand. iOS is really giving me a huge pain...
  7. Hi everyone, I am working on a scene that requires import meshes from .babylon file, most of the time I debug the scene on android mobile browser, and I got this error while trying to load the scene in iphone 5 & 6 (ios 10.2.1 up to date)safari browser: Error status: 0 - Unable to load myfile.babylon this is the link of the webpage I have no problem loading the scene on desktop, android mobile browser(chrome, firefox, opera), however, when I try to load the scene on iphone 6, most of the times I encounter the above error during the middle of importing mesh, if you open the webpage using iphone, there is a chance for you to stuck in the loading screen, when the error occurs. Nonetheless, there is a few times the scene can be successfully loaded, but only a few times. May I know if anyone who ever got with this error knows what is going on, as I am mainly working on the content of the 3D scene rather than handle the back-end part, thanks!
  8. Hi @davrous sorry for all the misleading information that I provided here, turns out I did not switch on the physical sound mode switch, I had no problem hearing the sounds now, thank you.
  9. hi @davrous, sorry for the lack of information, the thing is, I am certain that the sound is on, we had the volume check before and during accessing the website, and we had already added user input to play sound, below are the results: 1. on android mobile chrome browser - no need user input, all autoplay sound play flawlessly. 2. on iphone safari browser(not webapp, I am not opening the website link on home screen) - require first tap on screen to enable sound, after that sounds played properly. 3. on iphone webapp(when I said open in web app mode, what I mean is opening the website by adding it to mobile home screen first, then tap on the website icon at home screen to enter web app mode) - no sound is played. hi @pixelactivity, we did noticed the requirement of first tap to play sound on iphone safari browser, and that works on the iphone safari browser, but when we open the website in web app form, even with user input to call myAudio.play(), no sound can be heard, and yes, we are sure the sound is on. We initialised sound using Babylon.Sound, we even try to use web audio api to create sound(yes babylon has check the availability of web audio, we do that just to check), though it works on every other platform except iphone web app.
  10. Hi everyone, i was trying to pause a scene when the browser window is not active(eg. user switches tab, ctrl/cmd+tab, another window is currently focus,etc). To pause the scene, i need the background music and all animations to be paused, below playground example shows my approach: http://babylonjs-playground.com/#1MZCTQ I got two results: 1. when I click on another window(for example a notepad) that overlapped the browser, the notepad is now focus and the browser is blur, hence both sound and animation are paused, this is expected; 2. when I ctrl/cmd+tab or manually click on another tab to switch tab, only sound is paused but the animation continues playing. looks like $(window).blur(function() {...}); is triggered, but only bgm.pause() work, anim.pause() doesn't work. $(window).focus(function() { anim.restart(); bgm.play(); }); $(window).blur(function() { anim.pause(); bgm.pause(); }); any help will be appreciated, thank you!
  11. @Wingnut hi, I understand the growing BJS community and it is reasonable for questions being missed sometimes. And as the GearVR is currently not with me, I will test it on tomorrow morning(I currently stay in Singapore, it is now 12.01am). But based on my previous trial and error, there is something I am certain about while testing BJS WebVRFreeCamera with Samsung Internet using GearVR: 1. the device is certain in webvr mode during the testing ( I have seen the "WebVR is not enabled on your browser" error before when I first tried on GearVR,but that is because I have to manually type in internet://webvr-enable in Samsung internet url bar to enable webvr feature, after that the error's gone) 2. I had a button for switching between VRDeviceOrientation Camera and WebVRFreeCamera, if I pressed it to switch camera, it will do scene.activeCamera = new BABYLON.WebVRFreeCamera(...); and log window would return the current scene.activeCamera name. But everytime I pressed, there is no log result which I suspect the failure of WebVRFreeCamera initialisation. @davrous hi, I've seen this video which leads me to the Sponza demo, and I had tested the Sponza scene in GearVR. I can't remember the exact result of pressing the VR button already, it is either 1. switch to deviceOrientation camera(which i should see the two vr viewport display on the flat Samsung internet screen in front of me in GearVR( which is weird, because for what I remember, navigator.getVRDisplays return true during the beginning of each of my testing in GearVR), 2. or the scene shows no changes upon the button press, i will check again tomorrow, and it could be Samsung Internet is using webvr 1.1 too, so I am looking forward for Raanan's new WebVRFreeCamera! Finally, thank you all for the helps, BJS is very easy to learn and it helps me to build 3D scene on web page in a convenient way, I really appreciate all the active responses I got every times I ask a question here.
  12. hi everyone, sorry for pushing this up, just wondering if anyone has also tried to convert babylonjs scene into webvr experience specifically in GearVR's Samsung Internet? As I use GearVR to view a babylon demo that features webVRFreeCamera: http://david.blob.core.windows.net/babylonjs/SponzaVR/index.html but the camera doesn't work, and I was wondering the usability of WebVRFreeCamera in GearVR. Thank you.
  13. hi everyone, I look through the forum to see if anyone has worked on a babylonJS example that involved the use of WebVRFreeCamera with Samsung GearVR(with their phone device attached to the gear mini usb), since GearVR's internet browser "Samsung Internet" has webvr supported. But what I found mostly are people suggested using VRDeviceOrientationCamera for GearVR instead, which is using mobile screen as the vr display. So my question is as stated in the title: is it possible to just create a WebVRFreeCamera in the BJS scene for webvr experience to be worked on GearVR? I also found this example which uses Three.js and the webvr api, which I tested on gearVR's samsung internet and it works, but I had never learned Three.js before and I am keen to continue working on a babylon.js scene instead.
  14. ok, I think I solved the problem, to prevent the callback being called, I just set the first animatable's callback to null every times I want to restart the entire scene animation, reset the second animatables back to frame zero as well. http://www.babylonjs-playground.com/#OQENJ#7
  15. Hi @aWeirdo and @JohnK Thanks for both of your quick response! JohnK method works for me -- only if my issue is within the playground scene, the thing is, sry for the simplified scene, I realise I should have pointed out some part that make me resist in using scene.beginAnimation, the reason is that I had another animation within the callback of the first animatable: http://www.babylonjs-playground.com/#OQENJ#5 which using scene.beginAnimationI() will cause the animatable within the first animatable's callback being called without the first animatable completes its animation (you should be able to observe the second animatable start before the first animatable finish, by pressing the restart button before the box finish its animation). I try to I explain my problem as clear as possible, thanks for the help!
  16. Hi everyone, there might be a way of doing this but I must be missing something... I have a scene which consists of different meshes having different animations, all of the animation only run once. Basically, I would like to be able to "reload" the scene without actually reloading it, which I try to reset all the meshes' animations by pausing all unfinished meshes' animatable, set their animation's frame back to zero, and restart each of the animatable again. This method work when all of the animatables in scene have not reached their last frame. It won't work on those animatable who had reached its last frame, which their frame will be set to zero, but not able to be restarted. A simplified scene that showing my approach, as you will see the restart button doesn't work when the animation has reached its last frame. http://www.babylonjs-playground.com/#OQENJ Any help would be appreciated, thank you!
  17. @RaananW OMG it works! I didn't expect to be so easy but engine.setHardwareScalingLevel(value) results in a rather instant reaction of the vr camera! Thank you so much for suggesting that, I definitely need to explore more on BJS documentation. Just one thing that made me confused... is the default hardware scaling level = none? since I set engine.setHardwareScalingLevel(1) and it already run smoothly. @NasimiAsl Thank you for all the tips! Will try on them as my scene will eventually become complex and definitely need to be optimised.
  18. @RaananW I had done a few rough testing(as shown in the partial console.log result at the bottom), the vr camera rotation is updated 1~2 frame after the device orientation event triggered, so the problem would be slow rendering . Considering my scene is not a complex scene(for testing purpose the scene only consists of a ground mesh and skybox, a single directional light and of course, the vr camera), the slow rendering of vr camera really bothers me as it can affect the user experience significantly. Besides optimising the scene, I also think about speeding up the rendering times such as disable scene.render() in runRenderLoop when device orientation event is triggered, and let the device orientation event handle scene-render(), although I am not sure about how reliable this approach can be. Any idea of how I can improve the rendering speed when using vr camera will be much appreciated! I am also trying to figure out by myself at the same times. partial console.log results:
  19. @RaananW Hi, I need to update my question a bit: the DeviceOrientationCamera is actually running smoothly, it does react soon after I move my device which more or less match your description: start rotating one frame upon the broadcasting events. However, the VRDeviceOrientationFreeCamera is the one that has significant delay, I haven't test it yet, have something else to work on, once I have the testing result I will post here again. Thank you for the suggestion :).
  20. fyi, I am using samsung note 3 and htc one m8 to do the testing
  21. Hi everyone, I am currently working on a 3D scene that using VRDeviceOrientationFreeCamera and DeviceOrientationCamera, I experienced serious delay on both cameras. Based on what I have seen so far, it takes at least half a second for the camera to start rotate after I rotate my device. I try on other demo scenes with vr features enabled on babylonjs.com, there are also significant delay on the camera. Is this issue solvable by tweaking around the camera input or is it something we need to bear with if using the babylon default vr camera?
  22. also, since i don't need both the canvas and entire document to be fullscreen at the same time, below should be more or less the entire scope of the goFullscreen function: function goFullscreen(){ engine.switchFullscreen(true); }