Install
Papervision3D may be downloaded using a .swc file, .zip file, or subversion client and edited using an ActionScript editor.
.swc
- Download .swc
.zip
- Download .zip
- Extract and name folder Papervision3D - any location
Subversion Clients
svnX - macOS, open source
TortoiseSVN - Windows, open source
svnX
- Install svnX
- Open svnX
- Click Window
- Click Repositories
- Click +
- After Name: type Papervision3D
- After Path: type https://papervision3d.googlecode.com/svn/trunk/
- Double-click https://papervision3d.googlecode.com/svn/trunk/
- Click Checkout
- Click Documents
- Click New Folder
- Under Name of new folder: type Papervision3D
- Click Create
- Click Checkout
- Click Window
- Click Working Copies
- After Name: type Papervision3D
- After Path: type /Users/username/Documents/Papervision3D
TortoiseSVN
- Install TortoiseSVN
- Open Windows Explorer
- Click File
- Click New
- Click Folder, name folder Papervision3D - any location
- Right-click Papervision3D folder
- Click SVN Checkout...
- Under URL of Repository, type https://papervision3d.googlecode.com/svn/trunk/
- Click OK
- Click OK
ActionScript Editors
Adobe Flash Builder
- Install Adobe Flash Builder
- Open Adobe Flash Builder
Project
- Click File
- Click New
- Click ActionScript Project
- After Project name:, type Example - any location except Papervision3D folder
- Click Finish
Papervision3D
- Click Project
- Click Properties
- Select ActionScript Build Path
- Select Source path tab, then click Add Folder...
- Click Browse...
- Select Papervision3D folder, then
- src or only Papervision3D if src folder was not included - .zip
- as3\trunk\src - subversion client
- Click OK
- Click OK
- Click OK
AS
- Copy and paste code below
- Click File
- Click Save
Run
- Click Run
- Click Run Example
Adobe Flash Professional
- Install Adobe Flash Professional
- Open Adobe Flash Professional
Papervision3D
- Click Edit
- Click Preferences...
- Under Category, select ActionScript
- Click ActionScript 3.0 Settings...
- Click Add New Path (plus icon)
- Click Browse To Path (target icon)
- Select Papervision3D folder, then
- src or only Papervision3D if src folder was not included - .zip
- as3\trunk\src - subversion client
- Click OK
- Click OK
- Click OK
FLA
- Click File
- Click New...
- Select General tab
- Select Flash File (ActionScript 3.0)
- Click OK
- Click Window
- Click Properties
- Click Properties
- After Document Class:, type Example
- Click File
- Click Save
- After File name:, type Example.fla - any location except Papervision3D folder
- Click Save
AS
- Click File
- Click New...
- Select General tab
- Select ActionScript File
- Click OK
- Copy and paste code below
- Click File
- Click Save
- After File name:, type Example.as - same location as Example.fla
- Click Save
Test
- Click Control
- Click Test Movie
FDT
- Install FDT
- Open FDT
- Close Welcome
Project
- Click File
- Click New
- Click New Flash Project
- After Project name:, type Example - any location except Papervision3D folder
- Click Finish
- Click Window
- Click Show View
- Click Flash Explorer
- Under Flash Explorer, select Example
Papervision3D
- Click Project
- Click Properties
- Select FDT Build Path
- Click Add Linked Libraries...
- Click Add...
- Click New...
- After Name:, type Papervision3D - or preferred name
- Click Folder...
- Select Papervision3D folder, then
- src or only Papervision3D if src folder was not included - .zip
- as3\trunk\src - subversion client
- Click OK
- Click OK
- Click OK
- Click Finish
- Click OK
AS
- Click File
- Click New
- Click Class
- After Source Folder:, type src
- After Class Name:, type Example
- Click Finish
- Copy and paste code below
- Click File
- Click Save
Run
- Click Run
- Click Run
- Select FDT AS3 Application
- Click OK
FlashDevelop
- Install Microsoft .NET Framework - 2.0+
- Install Java Runtime Environment - 1.6+
- Install Adobe Flash Player Debugger
- Install FlashDevelop
- Open FlashDevelop
AS3PROJ
- Click Project
- Click New Project...
- Under ActionScript 3, select Empty Project
- After Name:, type Example - any location except Papervision3D folder
- Click OK
Papervision3D
- Click Project
- Click Properties...
- Under Classpaths tab, click Add Classpath...
- Select Papervision3D folder
- Select as3\trunk\src folders in subversion client
- Select src folder if src folder is included in .zip
- Click OK
- Click OK
- Click OK
AS
- Click File
- Click New...
- Click Blank Document
- Copy and paste code below
- Click File
- Click Save
- After File name:, type Example.as - same location as Example.as3proj
- Click Save
- Click View
- Click Project Manager
- Right-click Example.as
- Check Always Compile
SWF
- Click Project
- Click Properties...
- Under Output tab, after Output file:, type Example.swf - any location
- Click OK
Test
- Click Project
- Click Test Movie
Example
Code
package { import flash.display.Sprite; import flash.events.Event; import org.papervision3d.cameras.Camera3D; import org.papervision3d.events.InteractiveScene3DEvent; import org.papervision3d.materials.ColorMaterial; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.render.BasicRenderEngine; import org.papervision3d.scenes.Scene3D; import org.papervision3d.view.Viewport3D; public class Example extends Sprite { private var scene :Scene3D; private var camera :Camera3D; private var viewport :Viewport3D; private var renderer :BasicRenderEngine; private var material :ColorMaterial; private var object :Plane; public function Example() { scene = new Scene3D(); camera = new Camera3D(); viewport = new Viewport3D(); viewport.autoScaleToStage = true; viewport.interactive = true; addChild(viewport); renderer = new BasicRenderEngine(); material = new ColorMaterial(0x000000); material.doubleSided = true; material.interactive = true; object = new Plane(material); scene.addChild(object); object.addEventListener(InteractiveScene3DEvent.OBJECT_OVER, handleObjectOver); object.addEventListener(InteractiveScene3DEvent.OBJECT_OUT, handleObjectOut); object.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, handleObjectPress); addEventListener(Event.ENTER_FRAME, handleEnterFrame); } private function handleEnterFrame(e:Event):void { object.yaw(1); renderer.renderScene(scene, camera, viewport); } private function handleObjectOver(e:InteractiveScene3DEvent):void { viewport.containerSprite.buttonMode = true; } private function handleObjectOut(e:InteractiveScene3DEvent):void { viewport.containerSprite.buttonMode = false; } private function handleObjectPress(e:InteractiveScene3DEvent):void { material.fillColor = Math.random() * 0xFFFFFF; } } }