钓鱼方法钓鱼技巧钓鱼攻略钓鱼秘籍钓鱼装备,尽在渔夫子

三维粒子墙



 
/*Particle3d是将空间的三维粒子投影到二维平面上,如果场景中的MC是玩具,那当Particle3d就是操纵玩具的摇控器*/
  import Vector3d;
  class Particle3d {
  var position:Vector3d;
  var timeline:MovieClip;
  var mc:MovieClip;
  var scale:Number;
  function attachGraphic(mcID:String,depth:Number):MovieClip {
  return this.timeline.attachMovie(mcID,"mcID"+"_"+depth,depth);
  }
  /*刷新屏幕*/
  function render(viewDist:Number):Void{
 var pers:Number = position.getPerspective(viewDist);
 var screenPos:Vector3d =position.persProjectNew (pers);

  this.mc._x = screenPos.x;
  this.mc._y = -screenPos.y;
  this.mc._xscale = this.mc._yscale = scale * pers;
  this.mc.swapDepths (100000 - position.z * 100);
 
}
  function Particle3d(x:Number,y:Number,z:Number,timeline:MovieClip,mcID:String,depth:Number,viewDist:Number){
  this.position=new Vector3d(x,y,z);
  this.timeline=timeline;
  this.mc=this.attachGraphic(mcID, depth);
  this.scale=100;
  this.render(viewDist);
  }
  }


将此文件解压到C盘下,或自已更改类路径:wall3D
标签:flash
分类:生活点滴| 发布:渔夫子| 查看: | 发表时间:2006-8-5
原创文章如转载,请注明:转载自渔夫子 http://www.yufuzi.net/
本文链接:http://www.yufuzi.net/post/flsh_wall.html

相关文章

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。