This tutorial will show you how to basically import a 3D object into Flash, using Papervision.
IF you are completely new to this (i.e. need to know how to set up flash and PV3D, then please follow this tutorial steps 1-4 and read the beginners guide to creating your first 3D shapes here – if you want to know how to export 3D files into the COLLADA .DAE format that papervision read steps 2 -3 here.

This tutorial, assumes that you have read the other tutorials linked above, that provide full explanations for beginners!
In order to import a 3D object, you need to convert(export from 3Ds Max – COLLADA max extension can be downloaded here) it into a .DAE (COLLADA) file that papervision can use,  we will then use AS3 to read this file, and import the model.
package{ 
import org.papervision3d.view.BasicView; 
//For importing objects  
import org.papervision3d.objects.parsers.Collada; 
import org.papervision3d.objects.parsers.DAE; 
import org.papervision3d.objects.DisplayObject3D;

 [SWF(width="640", height="320", backgroundColor="#000000", frameRate="60")]

 public class import3D extends BasicView 
{  
public function import3D()  
{   
var myFirstObject= new Collada("myfirstobject.dae");   
//Set different scales, if your models is too small or too big   
myFirstObject.scaleX = 8;   
myFirstObject.scaleY = 8;   
myFirstObject.scaleZ = 8;   
//rotate object if you want it at a different angle   
myFirstObject.rotationX+=30;   
myFirstObject.rotationY+=30;   
scene.addChild(myFirstObject);

   startRendering();  
} 
}
}

And thats all there is to it! – very simple once you know how – keep an eye out for the next tutorial – TEXTURING! :)

subscribe to my RSS feeds, to get the latest updated tutorials!
Be Sociable, Share!

3 Responses to “Loading 3D objects created in Max (using COLLADA) into Flash AS3 with Papervision”

Leave a Reply

This site is using OpenAvatar based on

Subscribe
Follow me on Twitter
free counters
PayPal Donation
If you like this blog and the help it has given you, why not donate for this good cause? Click on the button below to pay Safely and Securely through PayPal.
Thanks.