Now, you have all the necessary elements to build your first scene. Here, the scene will be composed of a rotation camera, point light, and box. Let's create a class using TypeScript and practice with Babylon.js.
The following class creates the Babylon.js elements directly in the constructor:
export class BasicScene { public camera: BABYLON.ArcRotateCamera; // Our camera public light: BABYLON.PointLight; // Our light public box: BABYLON.Mesh; // Our box private _engine: BABYLON.Engine; // The Babylon.js engine private _scene: BABYLON.Scene; // The scene where to add the nodes // Our constructor. The constructor provides the canvas reference // Then, we can create the Babylon.js engine constructor(canvas: HTMLCanvasElement) { // Create engine this._engine = new BABYLON.Engine(canvas); // Create the scene this...