HSV Color Particles
パーティクルをHSVの値にそって並べてみました。
クリックで分解したり集合したりです。
このコンテンツではPV3DのParticleMaterialおよびParticleクラスを使用し、2000個のParticleMaterialそれぞれにHSVの色を割り付けてグラデーション的な表現を実現しています。
HSV Color Particles – wonderfl build flash online
それぞれのパーティクルに割り当てるカラーを生成してカラーからパーティクルを配置する頂点を生成し、パーティクルインスタンスに色と座標を割り当てる部分のコードは以下のようになっています。
private function addVertices():void{
_materials = new Particles();
var n:int;
var i:int;
var j:int;
//HSVのカラー情報をそれぞれループで生成
while(n < 10){
i = 0;
while(i < 10){
j = 0;
while(j < 20){
var h:Number = (360 / 20) * j;
var s:Number = i * .1;
var v:Number = n * .1;
//RGBに変換
var rgb:int = ColorUtil.hsvToRgb(h, s, v);
//色情報をもとにパーティクルを配置する頂点を生成
var vertices:Vertices = new Vertices();
vertices.y = v * 50 - 25;
vertices.x = Math.cos( h * Math.PI / 180 ) * (s * 30);
vertices.z = Math.sin( h * Math.PI / 180 ) * (s * 30);
vertices.color = rgb;
//
_verticesList.push(vertices);
//ParticleMaterialインスタンスを生成しカラーを適用
var mat:ParticleMaterial = new ParticleMaterial(rgb, 1, 1, 1);
var particle:Particle = new Particle(mat, 1, Math.random() * 300 - 150, Math.random()* 300 - 150, Math.random()* 300 - 150);
_materials.addParticle(particle);
_particleList.push(particle);
//
j++;
}
i++;
}
n++;
}
}
“HSV Color Particles” に対して2件のコメントがあります。
コメントは受け付けていません。

found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later
Great information! I’ve been looking for something like this for a while now. Thanks!