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.
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!



