Step1: Download Papervision3D_1_5.zip Papervision3D Class Packages - Rev 1.5
Step2: OPen new document: CTRL+N or file open new
Step3: Save files in PV3D_1_5\src folder
Step4: Paste code in first frame of action panel
// import the necessary files..
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
var container:Sprite=new Sprite();
container.x=stage.stageWidth*0.5;
container.y=stage.stageHeight*0.5;
addChild(container);
this.frameRate=40;
//creating scene basic for papervision; among multiple scenes Scene3D is basic one
var scene:Scene3D=new Scene3D(container);
//camera to see objects
var camera:Camera3D=new Camera3D();
//initial camera zoom is (0,0,0);
//to zoom object into scene..
camera.zoom=5;
//star making planes...
//create material-by attaching bitmap using BitmapAssetMaterial
var bam:BitmapAssetMaterial=new BitmapAssetMaterial("FlashIcon");
//by default material applied to one side of object(here plane);
bam.oneSide=false;
bam.smooth=true;
for (var i:int=0; i<50; i++) {
//new Plane(material,height, width,triangle num,triangle num)---triangle num to control quality
var p:Plane=new Plane(bam,250,150,2,2);
scene.addChild(p);
p.x=Math.random()*1000-500;//gives value from -500 to 500
p.y=Math.random()*1000-500;
p.z=Math.random()*1000-500;
p.rotationY=Math.random()*360;//rotate individual
}
this.addEventListener(Event.ENTER_FRAME,render);
function render(e:Event) {
camera.x+=stage.mouseX-(stage.stageWidth*0.5);
//p.rotationY+=2
camera.y+=stage.mouseY-(stage.stageHeight*0.5);
//to render camera.. to view scene
scene.renderCamera(camera);
}
Note: Code contains explanations..
Important please add an image in stage and give a linkage name for that here we used FlashIcon
SourceFile here
Read more
Step2: OPen new document: CTRL+N or file open new
Step3: Save files in PV3D_1_5\src folder
Step4: Paste code in first frame of action panel
// import the necessary files..
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
var container:Sprite=new Sprite();
container.x=stage.stageWidth*0.5;
container.y=stage.stageHeight*0.5;
addChild(container);
this.frameRate=40;
//creating scene basic for papervision; among multiple scenes Scene3D is basic one
var scene:Scene3D=new Scene3D(container);
//camera to see objects
var camera:Camera3D=new Camera3D();
//initial camera zoom is (0,0,0);
//to zoom object into scene..
camera.zoom=5;
//star making planes...
//create material-by attaching bitmap using BitmapAssetMaterial
var bam:BitmapAssetMaterial=new BitmapAssetMaterial("FlashIcon");
//by default material applied to one side of object(here plane);
bam.oneSide=false;
bam.smooth=true;
for (var i:int=0; i<50; i++) {
//new Plane(material,height, width,triangle num,triangle num)---triangle num to control quality
var p:Plane=new Plane(bam,250,150,2,2);
scene.addChild(p);
p.x=Math.random()*1000-500;//gives value from -500 to 500
p.y=Math.random()*1000-500;
p.z=Math.random()*1000-500;
p.rotationY=Math.random()*360;//rotate individual
}
this.addEventListener(Event.ENTER_FRAME,render);
function render(e:Event) {
camera.x+=stage.mouseX-(stage.stageWidth*0.5);
//p.rotationY+=2
camera.y+=stage.mouseY-(stage.stageHeight*0.5);
//to render camera.. to view scene
scene.renderCamera(camera);
}
Note: Code contains explanations..
Important please add an image in stage and give a linkage name for that here we used FlashIcon
SourceFile here