使用 PerspectiveCamera 时如何设置精灵大小始终相同 [英] How to set a sprite size always same when I use PerspectiveCamera
本文介绍了使用 PerspectiveCamera 时如何设置精灵大小始终相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在我有一个项目必须在 word 中设置一个大小始终相同的 obj.使用透视相机.我不想使用 OrthographicCamera
Now I have a project must set a obj in word always same size. Use PerspectiveCamera. I do not want use OrthographicCamera
推荐答案
如果你想防止精灵的尺寸衰减,并且你使用的是透视相机,你可以设置你的 sizeAttenuation
属性材料为假:
If you want to prevent size attenuation with sprites, and you are using a perspective camera, you can set the sizeAttenuation
property of your material to false:
var material = new THREE.SpriteMaterial( {
color: 0xffffff,
map: texture,
sizeAttenuation: false
} );
更新为three.js r.96
Updated to three.js r.96
这篇关于使用 PerspectiveCamera 时如何设置精灵大小始终相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文