codecamp

three.js SpotLightHelper

用于模拟聚光灯 SpotLight 的锥形辅助对象.

代码示例

const spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 10, 10, 10 );
scene.add( spotLight );

const spotLightHelper = new THREE.SpotLightHelper( spotLight );
scene.add( spotLightHelper );

例子

WebGL / lights / spotlights

构造函数

SpotLightHelper( light : SpotLight, color : Hex )

light -- 被模拟的聚光灯 SpotLight .

color -- (可选的) 如果没有赋值辅助对象将使用光源的颜色.

属性

请到基类 Object3D 页面查看公共属性.

.cone : LineSegments

用于模拟光源的 LineSegments 类型对象.

.light : SpotLight

被模拟的聚光灯 SpotLight .

.matrix : Object

请参考聚光灯的世界矩阵 matrixWorld.

.matrixAutoUpdate : Object

请查看 Object3D.matrixAutoUpdate. 这里设置为 false 表示辅助对象 使用聚光灯的 matrixWorld.

.color : hex

构造函数中传入的颜色值. 默认为 undefined. 如果改变该值, 辅助对象的颜色将在下一次 update 被调用时更新.

方法

请到基类 Object3D 页面查看公共属性.

.dispose () : undefined

销毁该聚光灯辅助对象.

.update () : undefined

更新聚光灯辅助对象.

源码

src/helpers/SpotLightHelper.js


three.js SkeletonHelper
three.js AmbientLight
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

参考

核心 / BufferAttributes

渲染器 / WebXR

开发者参考

WebGL渲染器

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }