Bitbybit Docs
    Bereite Suchindex vor...

    Funktion initBabylonJS

    • Helper function to initialize a basic BabylonJS scene with lights, shadows, and optional ground plane. This provides a quick setup for common use cases while remaining fully customizable.

      Parameter

      • Optionalinputs: InitBabylonJSDto

        Configuration options for the scene

      Rückgabewert InitBabylonJSResult

      Object containing the scene, engine, lights, ground, and dispose function

      import { initBabylonJS, BabylonJSScene } from "@bitbybit-dev/babylonjs";

      // Basic usage with defaults
      const { scene, engine } = initBabylonJS();

      // Custom configuration
      const options = new BabylonJSScene.InitBabylonJSDto();
      options.sceneSize = 500;
      options.enableGround = true;
      options.enableShadows = true;
      const { scene, engine, directionalLight } = initBabylonJS(options);