Babylon Area Light

Babylon.js Area Light

import * as REAL from "real_api_bbl";

export function AddLights(scene) {
  const width = 1;
  const height = 1;
  const color = new BABYLON.Color3(0.66, 0.56, 0.2);
  const intensity = 2;
  const light = new REAL.AreaLight(width, height, color, intensity);
  scene.addTransformNode(light);
}
Simple example of creating area light

Transform operations:

  • The transform operations such as rotate position and quaternion can be performed same as other three.js meshes

import * as REAL from "real_api_bbl";

export function AddLights(scene) {
  const width = 1.8;
  const height = 1.5;
  const color = new BABYLON.Color3(0.66, 0.56, 0.2);
  const intensity = 2;
  const light = new REAL.AreaLight(width, height, color, intensity);
  light.position.set(0, 1.5, -2.5);
  scene.addTransformNode(light);
}
After applying position

Last updated