最简单PV3D例子:
1 package
2 {
3 import flash.events.Event;
4
5 import org.papervision3d.objects.primitives.Sphere;
6 import org.papervision3d.view.BasicView;
7
8 public class HelloPV3D extends BasicView
9 {
10 private var sphere:Sphere;
11 public function HelloPV3D():void
12 {
13 sphere = new Sphere();
14 scene.addChild(sphere);
15 startRendering();
16 }
17 override protected function onRenderTick(event:Event=null) : void
18 {
19 sphere.rotationY+=2;
20 renderer.renderScene(scene,camera,viewport);
21 }
22 }
23 }
2 {
3 import flash.events.Event;
4
5 import org.papervision3d.objects.primitives.Sphere;
6 import org.papervision3d.view.BasicView;
7
8 public class HelloPV3D extends BasicView
9 {
10 private var sphere:Sphere;
11 public function HelloPV3D():void
12 {
13 sphere = new Sphere();
14 scene.addChild(sphere);
15 startRendering();
16 }
17 override protected function onRenderTick(event:Event=null) : void
18 {
19 sphere.rotationY+=2;
20 renderer.renderScene(scene,camera,viewport);
21 }
22 }
23 }
效果: