簡體   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