Hagop

Members
  • Content Count

    82
  • Joined

  • Last visited

About Hagop

  • Rank
    Advanced Member

Recent Profile Visitors

824 profile views
  1. Well Delatosh, if the camera position is updated before the target, then why is it working when camera.speed = 1 ? Anyhow afterRender solves the issue. Finally where do we specify camera.getViewMatrix(true) ?
  2. Hi all I needed to know if my free camera is moving or looking forward (+ve z) or backward (-ve z) at any given time. So I wrote the following code. var createScene = function () { var scene = new BABYLON.Scene(engine); var camera = new BABYLON.TouchCamera("TouchCamera1", new BABYLON.Vector3(0, 10, -60), scene); camera.speed = 6; scene.activeCamera = camera; camera.attachControl(canvas, true); var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); var ground = BABYLON.Mesh.CreateGround("ground1", 460, 460, 2, scene); return scene; }; var scene = createScene(); var switchDirection = false; var rayZ; var previousRayZ; scene.registerBeforeRender(function () { if(scene.isReady()) { scene.activeCamera.position.y = 20; directionRay = BABYLON.Ray.CreateNewFromTo(scene.activeCamera.position, scene.activeCamera.getTarget()).direction; rayZ = directionRay.z; if ( (rayZ >0 && previousRayZ <0) || (rayZ <0 && previousRayZ >0) ) { switchDirection = true; console.log("rayZ " +rayZ); console.log("previousRayZ " +previousRayZ); } if (switchDirection == true) { switchDirection = false; //do something } previousRayZ = rayZ; } }); I noticed the following abnormality in the trace when moving forward with the keyboard (the error does not occur when rotating with the mouse) rayZ -1 previousRayZ 1 This means scene.activeCamera.getTarget() is less that its position at some stage, whilst it should be always more... After a lot of headache I found out that this error occurs only if the camera speed is a large number ie: 5 The error does not occur when I have a mesh in front of the camera parented to the camera directionRay = scene.activeCamera.getFrontPosition(1).subtract( scene.activeCamera.position) Must be a bug
  3. I confirm my reported issue is FIXED in Babylon.js engine v3.2.0-beta.1
  4. Hagop

    WebGL and XML errors

    After upgrading to Babylon ver 3.2 at some stage Firefox 59.0, the error was caused on imported Babylon files which or the babylon file was renamed but the "producer" information kept the old file name Quite releived to see all those red line vanish from the Console. There seems to be a problem with binary files but I can live with it...
  5. OK, I see, however is there a way where we can restrict counting to a single BABYLON.SceneLoader.ImportMesh() call and discard the rest of the calls?
  6. Dear all Maybe this is a dummy question, but I couldn't figure out a workaround solution. I have created a scene using the standard var createScene = function() {}, after which I make MULTIPLE calls to import meshes BABYLON.SceneLoader.ImportMesh(). I try to display the Preloading screen using the following code var renderFunction = function () { if (scene) { var remaining = scene.getWaitingItemsCount(); if (remaining !=0) { engine.displayLoadingUI(); engine.loadingUIBackgroundColor = "green"; engine.loadingUIText = "Please Wait, An Incredible 3D Online Shopping Experience is Streaming: " + (remaining ? (remaining + " items remaining") : ""); } else if (remaining ==0) { engine.hideLoadingUI(); } scene.render(); } }; engine.runRenderLoop(renderFunction); The problme is that scene.getWaitingItemsCount() fluctuates, it decreases than increases, then decreases until it gets to zero. Is there a way for Counting to wait for ALL meshes/textures to QUEUE before it fires?
  7. Here is a playground https://playground.babylonjs.com/#TSHYWF#2 I am referring to animations without skeletons
  8. After upgrading to Babylon 3.2.0 alphaC from 3.0 3.2.0 scene.beginAnimation dows not seem to run. Here is the babylon mesh & animation details if it is of any help from console.log reg Name: dur1, isInstance: NO, # of submeshes: 3, n vertices: 943, parent: NONE, animation[0]: Name: Dur1Animation, property: position.x, datatype: Float, nKeys: 3, nRanges: 0, animation[0]: Name: Dur1ZAnimation, property: position.z, datatype: Float, nKeys: 3, nRanges: 0 dur1 Name: Dur1Animation, property: position.x, datatype: Float, nKeys: 3, nRanges: 0, Name: Dur1ZAnimation, property: position.z, datatype: Float, nKeys: 3, nRanges: 0
  9. snupas, Do you mean that the scene will be downloaded when running through a mobile app. So an app useless in case the scene is updated periodically?
  10. I have a heavy load Babylon scene (all meshes are optimized), which runs sufficiently well on desktops and tablets. The same site is slugish, slow or does not run at all on many mobiles when accesing through the mobiles browsers. I guess this is pretty normal since mobile GPUs are not as powerful as let's say tablets' GPU. So I guess the best thing to do is to test if the site is being accessed by a mobile device and divert the user to a mirror site where the textures are of lesser quality and the mesh sizes are smaller. Is that a correct solution? Is there any other ways of boosting performance Secondly, will wrapping the site into a Mobile app such as Cordova boost performance as compared to accessing the site through the mobiles' browser? Has anybody had experience with Windows apps running Babylon.js and were there any performance gains?
  11. @RaananW this is what I am trying to acheive.Click a product and drag down the mouse down to add into shopping cart. http://52.183.26.98/3d/index.html I am trying to move/rotate the products smoothly with shopping cart. That's why I have added parenting after dropping. As a temp solution, I have removed physics after dropping, but in this case products fall INTO one another
  12. Hi Delkatosh, thank you for the prompt reply. I just need the rotation logic/code for SIMPLE mesh (no physics applied) parented to camera (i guess it;s the same commands when parenting a mesh to another mesh)
  13. Hi all After I parent a mesh with impostor to a camera, and assign position to it relative to Camera, X & Z axis locations work correctly, but not Y-axis location. The mesh jumps up and actually the jumping depends on the value of the Y component the Cannon engine is initialized. Checkout http://playground.babylonjs.com/#1VNAYW#84
  14. Delete does not seem to work, because if after deleting physics if I parent the mesh to the camera and position it (after parenting the position of the mesh is relative to the camera), mesh makes a small jump.
  15. Dear all Can somebody point out the code segment in the source code of BABYLON.js or the commands that make a mesh parented to a FreeCamera rotate smoothly with the FreeCamera. The reason why I am asking this is because if I have a Physics impostor in the mesh and I parent it to the Free Camera, cannot control meshes position after parenting, so I am thinking of NOT parenting and rotating it manually.