View Mode: Normal | Article List

as3: ActionQueue

[ 2009-08-16 22:50:47 | Author: liuhuan ]
ActionQueue is a useful class executing actions in queue. You can download it at: http://www.libspark.org/svn/as3/ActionQueue/ActionQueue.as


package {
  import flash.display.*;
  import flash.events.*;

  public class Main extends Sprite {
    var aq:ActionQueue;
    public function Main():void {
      aq = new ActionQueue();
      initAction();
...

Read More...

PV3D: Bump map

[ 2009-08-16 14:06:16 | Author: liuhuan ]
uploads/200908/21_170447_untitled5.jpg



var bmp:Bitmap=new Bitmap(new Skin1(640,480));
var bmpBump:Bitmap=new Bitmap(new Bump(640,480));
var bmpMaterial:BitmapMaterial=new BitmapMaterial(bmp.bitmapData,true);
var shader:Shader=new PhongShader(light,0xFFFFFF,0x333333,50,bmpBump.bitmapData);
var shadedMaterial:ShadedMaterial=new
...

Read More...

PV3d: Star Sky

[ 2009-08-16 09:55:47 | Author: liuhuan ]


star disperse algorithm:
star.x = Math.sin(radian) * radius;
star.y = Math.floor(Math.random() * diameter);
star.z = Math.cos(radian) * radius;

Torch festival

[ 2009-08-15 22:19:42 | Author: liuhuan ]
uploads/200908/15_214916_img_1978.jpg

Silent Road

[ 2009-08-15 22:18:04 | Author: liuhuan ]
uploads/200908/15_214725_img_1881.jpg

Lu Shan, Xi Chang

[ 2009-08-15 22:11:05 | Author: liuhuan ]
uploads/200908/15_213938_img_1855.jpg

FLARToolKit

[ 2009-08-13 22:58:41 | Author: liuhuan ]
http://www.libspark.org/wiki/saqoosha/FLARToolKit/en

FLARToolKit recognize the marker from input image. and calculate its orientation and position in 3D world.

examples: http://flash.tarotaro.org/blog/

also: http://saqoosha.net/2008/08/31/1221/

AS3 Particle

[ 2009-08-12 17:47:08 | Author: liuhuan ]
An experiment with as3 bitmapdata.


import fl.controls.CheckBox;

var ease:Boolean = false;
var drawHolder:Sprite = new Sprite();
var line:Shape = new Shape();
drawHolder.addChild(line);
this.addChild(drawHolder);
stage.addEventListener(MouseEvent.MOUSE_DOWN , onMouseDownHandler);
var arr_particle:Array = new Array();
var textFormat:TextFormat = new TextFormat();
...

Read More...