forked from: forked from: flash on 2010-5-9

by narutohyper forked from forked from: flash on 2010-5-9 (diff: 8)
♥0 | Line 47 | Modified 2010-05-09 03:53:51 | MIT License
play

ActionScript3 source code

/**
 * Copyright narutohyper ( http://wonderfl.net/user/narutohyper )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/x5T6
 */

// forked from yooKo's forked from: flash on 2010-5-9
// forked from uwi's flash on 2010-5-9
package {
    import org.papervision3d.view.BasicView;
    import flash.text.TextField;
    import flash.events.Event;
    import net.hires.debug.Stats;
    import org.papervision3d.typography.*;
    import org.papervision3d.typography.fonts.*;
    import org.papervision3d.materials.special.*;
    import org.papervision3d.objects.*;
    import org.papervision3d.core.proto.*;
    
    [SWF(backgroundColor="0x000000", frameRate="60")]
    public class PV3D extends BasicView {
        private var _tf : TextField;
        private var m : MaterialObject3D;
        private var t : Text3D;
        
        public function PV3D() {
            super(0, 0, true, false);
            
            _tf = new TextField();
            addChild(_tf);
            _tf.textColor = 0xffffff;
            _tf.width = 100;
            _tf.height = 465;
            
//            addChild(new Stats());

			m = new Letter3DMaterial(0xffffff);
			m.doubleSided = true;
			t = new Text3D("nya-", new HelveticaLight(), m);
			scene.addChild(t);
			
			camera.x = 100;
			camera.y = 200;
			camera.z = 300;
			camera.lookAt(t);
		


            startRendering();
        }
        
        override protected function onRenderTick(e : Event = null) : void
        {
            super.onRenderTick(e);
            camera.x ++;
            //t.rotationX ++;
            //t.rotationY ++;
			t.lookAt(camera);
			t.localRotationY = 180;	
            tr( t.rotationX );
        }
        
        private function tr(...o : Array) : void
        {
            _tf.appendText(o + "\n");
            _tf.scrollV = _tf.maxScrollV;
        }
    }
}