【发布时间】:2013-02-26 14:38:22
【问题描述】:
是否可以在 Three.js 中创建具有自定义几何形状的光源,例如象征。 Three.js 中的 Arealight 作为矩形光源,具有 wigth 和 height 参数。 最后,目标是获得由此类光源照亮的表面,这在视觉上就是那个自定义图形。
谢谢 WestLangley,这是一个很好的例子,我尝试过这种方式,但不幸的是,它对我不起作用。我试过这个:
var textTexture = new THREE.Texture( "textures/text.jpg" );
//var textTexture = THREE.ImageUtils.loadTexture("textures/text.jpg");
textTexture.format = THREE.RGBFormat;
textTexture.wrapS = textTexture.wrapT = THREE.MirroredRepeatWrapping;
textTexture.anisotropy = 4;
var textLight = new THREE.AreaLight( 0xffffff, 3 );
textLight.position.set( 10, 5, -5 );
textLight.rotation.x = Math.PI / 2;
textLight.width = 30;
textLight.height = 10;
textLight.texture = textTexture;
scene.add(textLight)
【问题讨论】: