Acabo de conocer babylon.js y comencé a probarlo. Sigo este video de youtube para principiantes. Usé CDN para usar babylon.js como https://cdn.jsdelivr.net/npm/babylonjs@4.2.0/babylon.js .
Este es el programa que escribí 👇
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <style> body { margin: 0; padding: 0; height: 100vh; overflow: hidden; } canvas { width: 100%; height: 100%; } </style> <body> <canvas id="renderCanvas"></canvas> <script src="https://cdn.jsdelivr.net/npm/babylonjs@4.2.0/babylon.js"></script> <script> const canvas = document.getElementById("renderCanvas"); const engine = BABYLON.Engine(canvas, true); function createScene() { const scene = new BABYLON.Scene(engine); const camera = new BABYLON.FreeCamera('camera', new BABYLON.Vector3(0, 0, 0), scene); const light = new BABYLON.HemisphericLight('light', new BABYLON.Vector3(0, 1, 0), scene); return scene; } const scene = createScene(); engine.runRenderLoop(()=>{ scene.render(); }) </script> </body> </html>Cuando ejecuto el programa me muestra este error en la consola 👇
Uncaught TypeError: this.resize is not a function at Module.e (babylon.js:16) at Module.t (babylon.js:16) at index.html:29¿Cómo debo resolver este problema?