Jump to content

Hagop

Members
  • Posts

    83
  • Joined

  • Last visited

Recent Profile Visitors

1,752 profile views

Hagop's Achievements

  1. Is there anyway you can read the console? That would be helpful. The first thing that comes to my mind is texture size. We had a problem with iPhones. We found out that it does not support > 1024x1024 pixels and after reducing texture size, we solved the problem.
  2. 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) ?
  3. 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
  4. I confirm my reported issue is FIXED in Babylon.js engine v3.2.0-beta.1
  5. 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...
  6. 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?
  7. 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?
  8. Here is a playground https://playground.babylonjs.com/#TSHYWF#2 I am referring to animations without skeletons
  9. 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
  10. 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?
  11. 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?
  12. @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
  13. 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)
  14. 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
  15. 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.
×
×
  • Create New...