从three.js r62Dev更新为r64或r64Dev后,我收到以下错误。
var radarMaterial = new THREE.SpriteMaterial( { map: radarTexture2, useScreenCoordinates: true, alignment: THREE.SpriteAlignment.topLeft } );
未捕获的TypeError:无法读取未定义的属性“topLeft”。
还有其他人经历过这个吗?
答案 0 :(得分:13)
SpriteMaterial.alignment
和SpriteMaterial.useScreenCoordinates
已从Threejs中移除。请参阅发布历史记录:https://github.com/mrdoob/three.js/releases。
Sprite现在在场景中呈现,就像任何其他对象一样。
如果你想创建一个抬头显示器(HUD),解决方法是覆盖第二个精灵场景,用正交相机渲染。
有关如何执行此操作的示例,请参阅http://threejs.org/examples/webgl_sprites.html。
three.js r.64