跳至主要內容

PointLightHelper

yisky小于 1 分钟组件文档组件助手点光源助手PointLightHelper

PointLightHelper——点光源助手,用于模拟点光源(PointLight)的辅助渲染组件,如下图所示:

重要

  • 在添加 PointLightHelper 组件前请务必确保实体已经添加 PointLight 组件;
  • PointLightHelper 组件由 @fantasy3d/addons 包提供。

创建

import { PointLight } from '@fantasy3d/core';
import { PointLightHelper } from '@fantasy3d/addons';

const { rootEntity } = scene;

// 在场景根实体上添加点光源组件
const light = rootEntity.addComponent( PointLight, {

    color: '#ffffff',               // 点光颜色
    intensity: 600.0 * Math.PI,     // 点光强度
    distance: 100.0                 // 点光照射距离

} );

// 添加点光源助手
light.addComponent( PointLightHelper );
上次编辑于: