I’m using an animated player to get different icons from his actions (idle, running, jumping, sliding, etc). Using ThreeJS r95.
To do this, I place the player in the corresponding action pose, fit the player into the camera bounds, render the scene and get the image from the canvas.
Everything works fine, except when the player is in a pose other than the default one (eg: jumping or sliding). The player ‘is not fitted’ into the camera bounds and he gets cropped in the image.
Investigating a bit, it seems that the bounding box values are not updated with the animation, so the player can’t be fit properly into the camera bounds.
I’ve created a codepen for testing, using the marine from ThreeJS examples. By the way, my player is in GLTF format and marine is in JSON format, so the problem is not related to the 3D object itself.
https://codepen.io/Eketol/pen/oMJYxM
I’ve tried several things like force updating the matrix, computing the geometry’s boundingbox, etc. But no success. Not sure if I’m doing something wrong or if it is a bug.
-
Is it possible to get the animated player’s bounds while he is in a pose other than the default one?
-
Perhaps it is not a bug, but a feature (because it could be a performance issue). Maybe the bouds can be updated on demand by calling ‘updateBoundingBox()’ or with some flag like ‘updateBoundsOnAnimation = true’?