Demo entry 1076225

Colored

   

Submitted by anonymous on Jan 14, 2015 at 17:41
Language: ActionScript 3. Code size: 2.5 kB.

package  {
	
	import flash.events.Event;
	import org.papervision3d.objects.parsers.DAE;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.KeyboardEvent;
	import flash.ui.Keyboard;
	
	[SWF(width=640, height=480, backgroundColor=0x808080, frameRate=30)]	
	
	public class Main extends PV3DARApp {
		
		private var _earth:DAE;
		
		public function Main() {
			stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressedDown);
			addEventListener(Event.INIT, _onInit);
			init('Data/camera_para.dat', 'Data/flarlogo.pat');
		}
		
		//Funcion Teclado
		
		private function keyPressedDown(event: KeyboardEvent):String {
			var modelo:String;
			var key:uint = event.keyCode;
			switch (key) {
				case Keyboard.Q:
					_earth.load("model/Tubo.dae");
					break;
				case Keyboard.W:
					_earth.load("model/Piramide.dae");
					break;
				case Keyboard.E:
					_earth.load("model/Cubo.dae");
					break;
				case Keyboard.R:
					_earth.load("model/Esfera.dae");
					break;
				case Keyboard.T:
					_earth.load("model/earth.dae");
					break;
				case Keyboard.Y:
					_earth.load("model/Cono.dae");
					break;
				case Keyboard.U:
					_earth.load("model/banc.dae");
					break;
				case Keyboard.I:
					_earth.load("model/box.dae");
					break;
				case Keyboard.O:
					_earth.load("model/donut.dae");
					break;
				case Keyboard.P:
					_earth.load("model/materials.dae");
					break;
					case Keyboard.A:
					_earth.load("model/terra.dae");
					break;
				case Keyboard.S:
					_earth.load("model/tierra 2.dae");
					break;
				case Keyboard.D:
					_earth.load("model/triangles.dae");
					break;
				case Keyboard.UP:
					augmentar();
					break;
				case Keyboard.DOWN:
					disminuir();
					break;
				case Keyboard.LEFT:
					rotariz();
					break;
				case Keyboard.RIGHT:
					rotarde();
					break;
			}
			return modelo;
		}
		
		//Funciones Representacion Modelo 3D y Captura Pattern
		
		private function _onInit(e:Event):void {
			_earth = new DAE();
			_earth.scale = 1;
			_earth.rotationX = 90;
			_markerNode.addChild(_earth);
			
			addEventListener(Event.ENTER_FRAME, _update);
		}
		
		private function _update(e:Event):void {
			
		}
		
		public function augmentar(): void {
			_earth.scale += 1;
		}
		public function disminuir(): void {
			_earth.scale -= 1;
		}
		public function rotariz(): void{
			_earth.rotationZ -= 3;
		}
		public function rotarde(): void{
			_earth.rotationZ += 3;
		}

	}
	
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).