cx20 Posted November 27, 2016 Share Posted November 27, 2016 Hello! I am trying glTF Loader now. VC.gltf (Virtual City) sample contains 15 cameras. I understood how to switch cameras using Three.js + glTF Loader. However, I do not know how to switch it with Babylon.js + glTF Loader. Three.js + glTF Loader + VC.gltf (working) -> http://jsdo.it/cx20/ErGZ Babylon.js + glTF Loader + VC.gltf (not work) -> http://jsdo.it/cx20/eyjr Can anyone tell me how to switch embedded cameras with Babylon.js + glTF Loader? Thanks. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 28, 2016 Share Posted November 28, 2016 Hi @cx20, The glTF loader loades two types of cameras (perspective and orthographic) from the file and adds them as a free camera to the scene with the name defined in the glTF file. To switch between camera, babylon itself offers a few ways: 1) setting the scene.activeCamera manually 2) using the scene.setActiveCameraByID or setActiveCameraByName functions 3) Disposing the unneeded camera (that was probably initially created). Or better yet - don't create any camera before loading the file, babylon should be setting the first camera added to the the active camera. cx20 1 Quote Link to comment Share on other sites More sharing options...
cx20 Posted November 28, 2016 Author Share Posted November 28, 2016 RaananW san Thanks for the advice. I want to try it. 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.