Jump to content

Mesh not displayed after skeletal animation carries infront of camera?


petemac
 Share

Recommended Posts

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.

post-16561-0-42007800-1443146260.png

post-16561-0-77642100-1443146271.png

post-16561-0-38348600-1443146276.png

Link to comment
Share on other sites

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?BONES

From the tutorial here http://doc.babylonjs.com/tutorials/How_to_use_Bones_and_Skeletons

It 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.

 

 

post-16561-0-24373000-1443425115.png

post-16561-0-03102700-1443425124.png

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Sure :)

 

the boundingInfo are retrieved using mesh.getBoundingInfo()

 

The returned object contains the boundingSphere and the boundingBox:

http://doc.babylonjs.com/classes/2.2/BoundingBox

http://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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...