繁体   English   中英

沿三维Three.js的精灵大小

[英]Size of sprites along geometry Three.js

我想沿图显示精灵的动画。 专门移动精灵行走图。 因此如下所示:

http://armsglobe.chromeexperiments.com/

我基于这个问题的答案:

http://stackoverflow.com/questions/25898635/three-js-how-to-animate-particles-along-a-line

在此处输入图片说明

这是我的结果,精灵从小开始,然后变大。 我想要一样大小的人。

但是我需要你们所有的精灵都一样大小。 我看了看代码,但不知道如何对所有相同大小的精灵执行操作。

如果您能提供帮助,我将不胜感激。 在此处输入图片说明

Sprite不能使用sizeAttenuation功能为false。 您需要使用Pointcloud http://codepen.io/seanseansean/pen/EaBZEY

您要搜索的pontCloud资料中的参数是sizeAttenuation= false

将使所有粒子尺寸相对于画布尺寸。 不会改变观点。

var geometry = new THREE.Geometry();      
    geometry.vertices.push( new THREE.Vector3() );
var size = 32; // means 32px

var sectorIcon = new THREE.PointCloud( geometry, new THREE.PointCloudMaterial( { size: size, color: new THREE.Color( 0xffffff ), depthTest: 1, depthWrite: false,  opacity: 0.5, sizeAttenuation: false, blending: THREE.AdditiveBlending, transparent: true, map: THREE.ImageUtils.loadTexture("img/sectors/"+value.image_file) } ) );

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM