Javascript 如何使用SpriteMaterial和方向光获得阴影
我的代码: 平行光: 雪碧:Javascript 如何使用SpriteMaterial和方向光获得阴影,javascript,three.js,Javascript,Three.js,我的代码: 平行光: 雪碧: 结果是我的飞机有阴影,但没有精灵三个精灵中的精灵不投射阴影 一种解决方法是使用平面几何体,如下所示: scene.add( plane ); plane.lookAt( camera ); 注意:LookAt()如果平面是旋转对象的子对象,则无法正常工作;一定是现场的孩子 three.js r.74如果为精灵对象设置castShadow,我们是否可以为threejs添加警告?我认为最好在文档中添加一个符号。 var spriteMaterial = new THR
结果是我的飞机有阴影,但没有精灵三个精灵中的精灵不投射阴影 一种解决方法是使用
平面几何体
,如下所示:
scene.add( plane );
plane.lookAt( camera );
注意:LookAt()
如果平面是旋转对象的子对象,则无法正常工作;一定是现场的孩子
three.js r.74如果为精灵对象设置castShadow,我们是否可以为threejs添加警告?我认为最好在文档中添加一个符号。
var spriteMaterial = new THREE.SpriteMaterial({map: texture});
var info = new THREE.Sprite( spriteMaterial );
info.castShadow = true;
info.scale.set(infoScale, infoScale, infoScale);
info.name = continent.label;
info.userData.continent = continent;
info.userData.id = continent.id;
info.userData.type = 'info';
hubInfos.push(info);
scene.add( plane );
plane.lookAt( camera );