forked from: flash on 2010-7-26
/**
* Copyright hig_an ( http://wonderfl.net/user/hig_an )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/dUlh
*/
// forked from hig_an's flash on 2010-7-26
package {
import org.papervision3d.materials.special.CompositeMaterial;
import org.papervision3d.view.*;
import org.papervision3d.materials.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.primitives.*;
import flash.events.*;
public class FlashTest extends BasicView {
private var planes:Array;
private var bar_number:uint;
private var num:Array;
public function FlashTest() {
bar_number = 8
var material:ColorMaterial = new ColorMaterial(0xFFCC00);
num = new Array( 0, 1, 2, 1, 0, -1, -2, -1);
material.doubleSided = true;
planes = new Array();
for (var i:int = 0; i < bar_number; i++) {
planes[i] = new Plane(material, 300, 100, 1, 1);
var p:Plane = planes[i];
p.x = 200 * Math.sin(i * 90 * Math.PI / 180);
p.y = 200 * num[i];
p.rotationZ = i * 90;
scene.addChild(p);
}
startRendering();
addEventListener(Event.ENTER_FRAME, loop);
camera.y = 0;
}
private function loop(e:Event):void {
camera.x -= (camera.x - Math.sin(mouseX * 0.01) * 1000) / 8;
camera.z -= (camera.z - Math.cos(mouseX * 0.01) * 1000) / 8;
camera.y -= (camera.y - viewport.containerSprite.mouseY * 5) / 8;
}
}
}