The glb link: scene4_7CameraBaked_QA.glb - Google Drive
I have a glb scene. If you put it into sandbox, there will be camera animation associated with camera0
. The related animation is animation0_channel0
and animation0_channel1
.
How can I import this scene and play the animation?
Note I will create a const cameraCreated = new BABYLON.FreeCamera()
. Can cameraCreated
simulate the animation?
https://playground.babylonjs.com/#0RMKXJ
You can import a glTF/glb object this way:
https://playground.babylonjs.com/#WGZLGJ
To make your assets available in the Playground: Using External Assets In the Playground | Babylon.js Documentation
When you import a file with animations, I think the first one is automatically played (but you can play others, of course).
1 Like
var camera0 = scene.getNodeByName("camera0");
scene.activeCamera = camera0;
It turns out just set active camera to camera0
, the animation will auto play at the start point.