petemac Posted September 25, 2015 Share Posted September 25, 2015 Hello.Was playing around in my scene and I noticed some odd animation mesh popping behavior.I investigated further and I came to the conclusion that when an animation starts off screen (you cant see the mesh) and the skeleton of the mesh carries the mesh by animation infront of the camera, it will not display the mesh. However if you look at the mesh when the animation starts everything works correctly.I tried finding any information I could but with no luck. Maybe it is a bug?This happens in Chrome and Safari*mobile, havent tested anywhere else.I uploaded some images to further illustrate what I am experiencing.If the sphere mesh is not displayed in camera when the animation starts, it will not be shown when the animation carries the sphere mesh over infront of the camera.BABYLON.SceneLoader.ImportMesh("","firstpersongame/", "untitledz.babylon", scene,function (newMeshes, skeleton){scene.beginAnimation(newMeshes[0].skeleton, 0, 49, 1.0, true);}});Right now I am pressed for time, I will try to upload a playground or something later.Any help on this would be great!Thank you for your time. Quote Link to comment Share on other sites More sharing options...
petemac Posted September 28, 2015 Author Share Posted September 28, 2015 I tried making a playground however I ran into trouble, I couldnt figure out how to link to one of my custom .babylon files via the loader and playground.I did find this http://www.babylonjs.com/index.html?BONESFrom the tutorial here http://doc.babylonjs.com/tutorials/How_to_use_Bones_and_SkeletonsIt is a character with animations just like I describe, the same situation happens.If you zoom and and look at the character and then slowly move the camera to where you can just see his hand and foot moving. Move camera a little further and then all of a sudden the foot instead of still swining infront of the camera, stops, where you should still be able to see his foot swinging, but because you moved the camera far enough to where you cant see the starting point of the mesh or skeleton, it does not show the animation when it should carry mesh onto screen.Ill add some more pictures to demonstrate what I mean again. Im almost positive its a bug, Its happening in a scene from the tutorial section. Please take a look at this.Thank you. Quote Link to comment Share on other sites More sharing options...
Temechon Posted September 28, 2015 Share Posted September 28, 2015 Hello! It seems the mesh is not in front of the camera anymore, so its animation is not computed.Did you try to reduce the minZ of the camera?Try this: myCamera.minZ = 0.1;And tell me if that's change anything. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 28, 2015 Share Posted September 28, 2015 Hello petemac, you are right about your analysis. The bounding box is not updated when you animate a mesh with a skeleton as the animation is done on the GPU. You can manually force the mesh to always be active: mesh.alwaysSelectAsActiveMesh = true OR you can update manually the bounding box to reflect the updates done by the skeleton Quote Link to comment Share on other sites More sharing options...
petemac Posted September 29, 2015 Author Share Posted September 29, 2015 Thank you Deltakosh!I would like to update the bounding box to reflect the updates done by the skeleton,However, sadly, I have no idea how to do this.Any suggestions to get me started? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 29, 2015 Share Posted September 29, 2015 Sure the boundingInfo are retrieved using mesh.getBoundingInfo() The returned object contains the boundingSphere and the boundingBox:http://doc.babylonjs.com/classes/2.2/BoundingBoxhttp://doc.babylonjs.com/classes/2.2/BoundingSphere Each boundingXXX has properties finishing by World like: http://doc.babylonjs.com/classes/2.2/BoundingSphere#centerworld-vector3-classes-2-2-vector3- You can then update these values to reflect the updates done by the skeleton. For instance, the boundingSphere.centerWorld may need to be moved where the mesh is actually rendered Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.