Loading scenes with Babylon.js programmatically

To load scenes using TypeScript, Babylon.js provides you with a class named BABYLON.SceneLoader. This class contains static methods that allow you to load scenes (create new ones), append scenes, and load meshes.

Basically, as a developer, you'll load files using these methods. The .Load method creates a new scene for you and loads everything (meshes, lights, particle systems, camera, and so on), returning the new scene. The.Append method takes an existing scene as a parameter and appends a new scene to the existing one (useful to mix multiple scenes). Finally, the.ImportMesh method imports only meshes, skeletons (refer to Chapter 9Create and Play Animations about animations), and particle systems ...

Get Babylon.js Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.