| flash game tutorial and flare3d games

Latest Blog



07.04.2018

Membuat Game Tebak Gambar

Tutorial membuat game tebak gambar dengan Flash

03.07.2017

Memahami konstain

Memahami penggunaan konstrain dalam membuat sistem gerak

28.01.2017

E-Book Media Pembelajaran

E Book Gratis Membuat Media Pembelajaran Interaktif

15.12.2016

Membuat mouse trail

Membuat animasi ikan mengikuti kursor mouse

23.04.2016

Animasi Karakter Game RPG Flash

Membuat animasi karakter dalam game RPG Flash

23.04.2016

Aplikasi Peta Game RPG Flash

Mengaplikasikan Map Editor untuk peta game RPG Flash

23.04.2016

Membuat Peta Game RPG Flash

Membuat peta untuk game RPG Flash

23.04.2016

Mengerakkan Karakter Game RPG

Menambahkan karakter dalam game RPG Flash

23.04.2016

Membuat Game RPG

Membuat game RPG Flash actionscript 3 dengan teknik tiling

31.12.2015

Indonesia Soccer League

Sekilas tentang pengembangan game sepakbola dengan Flash


ALL BLOG

Latest Games


;
Free Games

Indonesia Soccer League

Play Indonesian Soccer League on Flash 3D Games

Viewer 3D - Simple way to load 3D model into flash application

Preparation

This tutorial will show you how to load a 3D model, in F3D (flare3D) format into flash application using Viewer3D. To do this tutorial, you need some preparation :

  • First installation of Flash Develop and Flare3D. You can check the complete guide here
  • 3D model in F3D (Flare3D) format. You can download the model file on the link at the end of this tutorial.
  • Flare3D Library in SWC format. You can find it on Flare3D installation folder

Step by step tutorial using Viewer3D

  1. Run FlashDevelop and create a new project (choose Project > New Project)
  2. Choose AS3 Project, and write "Tutorial01_Viewer3D" as name, and make sure the "Create directory for project" option is selected.
    viewer3d by wandah_w
  3. Once you press OK button, the project folder will be created. You'll find 3 different folder (bin, lib and src).
  4. Copy the 3D model file into bin folder and copy the Flare3D library file into lib folder.
    viewer3d by wandah_w
  5. Back to FlashDevelop. On the Project Manager panel (on the right side), expand the lib folder, and you'll find Flare3D library files. Right click that library and select Add To Library.
    viewer3d by wandah_w
  6. On the Project Manager panel. Right click on the Project Properties and choose Properties.
    flare3D setup by wandah_w
  7. In the Output tab, Platform group box, select Flash Player version 11.7
    flare3D setup by wandah_w
  8. Go to the SDK tab and make sure that Flex 4.6.0, AIR 3.1 or the latest version is the selected SDK . Press OK
    flare3D setup by wandah_w
  9. Now expand src folder. You'll find Main.as the main class of the project. This is the "code files". Double click that files to open it into Editor Panel.
    To load the 3D model that we have on the lib folder, we need to add some codes into Main.as. Copy the code below :
    package 
    {
    	import flash.display.Sprite;
    	import flash.events.Event;
    	import flare.basic.*;
    	import flare.core.*;
    	import flare.loaders.*;
    	import flare.system.*;
    
    	/**
    	 * ...
    	 * @author wandah
    	 */
    	public class Main extends Sprite 
    	{
    		private var scene:Scene3D;
    		private var truk:Pivot3D;		
    		
    		public function Main():void 
    		{
    			if (stage) init();
    			else addEventListener(Event.ADDED_TO_STAGE, init);
    		}
    		
    		private function init(e:Event = null):void 
    		{
    			removeEventListener(Event.ADDED_TO_STAGE, init);
    			// entry point
    			
    			// setup Viewer3D
    			scene = new Viewer3D( this );
    			scene.antialias = 2;
    			
    			// add loading listener
    			scene.addEventListener( Scene3D.PROGRESS_EVENT, progressEvent );
    			scene.addEventListener( Scene3D.COMPLETE_EVENT, completeEvent );
    			
    			// open the 3D file
    			truk = scene.addChildFromFile( "truk.f3d" );
    			
    			scene.pause();
    		}
    		
    		private function progressEvent(e:Event):void 
    		{
    			// loading event
    			trace( scene.loadProgress );
    		}
    		
    		private function completeEvent(e:Event):void 
    		{
    			// loading complete 			
    			scene.resume();
    		}
    	}
    	
    }
    				
  10. Run the project by pressing Ctrl+Enter or F5 button. If there is no mistake on the Flare3D and Flash Develop Installation, and there is no mistake with the codes then you'll see the 3d model on your flash application. You can zoom in and zoom out the model using mouse roll, and drag mouse to rotate it.

Project Output

Here the output of the project. As you can see, using Flare3D we can easily load any 3D model in F3D format with less than 10 line of viewer3D codes. Write me some feedback if about it, or if you find any problem just write a comment. Thanks!

Get Adobe Flash player

File Source

Here you can download the full source DOWNLOAD PROJECT



Share ( Ayo Berbagi )

Leave me a comment

untuk pertanyaan lebih baik di email langsung ke wandah [at] wandah [dot] com agar cepat direspon