• Content count

  • Joined

  • Last visited

About AB95

  • Rank
  • Birthday 12/29/1995

Profile Information

  • Gender
  • Location
    Johor, Malaysia
  • Interests
    Icon design, writing song, playing guitar
  1. @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.
  2. 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.
  3. 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.
  4. 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
  5. 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!
  6. 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!
  7. @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.
  8. @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:
  9. @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 :).
  10. fyi, I am using samsung note 3 and htc one m8 to do the testing
  11. 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?
  12. 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); }
  13. Hello @aWeirdo Thank you for the suggestion of reading the Presentation differences part, I have solved my problem! The "Presentation differences" section points out some part that sounds similar with the behaviour of my fullscreen issue: something slightly different would be my canvas is not centered (looks like it is shifted 50% below the top of the screen) while remaining area black, the solution recommended by the fullscreen API website is as shown below: #myvideo:-webkit-full-screen { width: 100%; height: 100%; } #myvideo is known to refer to the id we set for the canvas element. This solution doesn't work for me, BUT! this solution may work for <div> element but not <canvas> element (as we know babylon makes use of explicitly defined HTML canvas element to hold 3D graphics). So instead, we could explicitly center the canvas and make it fullscreen using css: #my-canvas:-webkit-full-screen { position: absolute; width: 100%; height: 100%; left:0; right:0; top:0; bottom:0; margin:auto; } and that solves my issue.
  14. Just noticed I missed doing engine.resize() when it is not a mobile device: window.addEventListener("resize", function() { if (!is_mobile()){ engine.resize(); return; } if (isLandscape()){ scene.activeCamera = vrCamera; vrCamera.attachControl(canvas,false); }else{ scene.activeCamera = devOrienCamera; devOrienCamera.attachControl(canvas,false); } engine.resize(); }); but this is not what cause the android browser fullscreen issue, this will only cause distortion of the scene on pc browser, adding the engine.resize within (!is_mobile) if condition will solve the distortion issue, just point out in case of any confusion.
  15. Hello! Thank you for reviewing my question My device android version is 5.0. Does "newer" android version mean 6.0 onward?