Menu
Samaritan's Purse

INSTALL

Papervision3D may be downloaded using a .swc file, .zip file, or subversion client and edited using an ActionScript editor.

.SWC

  1. Download .swc

.ZIP

  1. Download .zip
  2. Extract and name folder Papervision3D - any location

SUBVERSION CLIENTS

svnX - macOS, open source

TortoiseSVN - Windows, open source

SVNX

  1. Install svnX
  2. Open svnX
  3. Click Window
  4. Click Repositories
  5. Click +
  6. After Name: type Papervision3D
  7. After Path: type http://papervision3d.googlecode.com/svn/trunk/
  8. Double-click http://papervision3d.googlecode.com/svn/trunk/
  9. Click Checkout
  10. Click Documents
  11. Click New Folder
  12. Under Name of new folder: type Papervision3D
  13. Click Create
  14. Click Checkout
  15. Click Window
  16. Click Working Copies
  17. After Name: type Papervision3D
  18. After Path: type /Users/username/Documents/Papervision3D

TORTOISESVN

  1. Install TortoiseSVN
  2. Open Windows Explorer
  3. Click File
  4. Click New
  5. Click Folder, name folder Papervision3D - any location
  6. Right-click Papervision3D folder
  7. Click SVN Checkout...
  8. Under URL of Repository, type http://papervision3d.googlecode.com/svn/trunk/
  9. Click OK
  10. Click OK

ACTIONSCRIPT EDITORS

Adobe Flash Builder

Adobe Flash Professional

FDT

FlashDevelop - open source

ADOBE FLASH BUILDER

  1. Install Adobe Flash Builder
  2. Open Adobe Flash Builder

PROJECT

  1. Click File
  2. Click New
  3. Click ActionScript Project
  4. After Project name:, type Example - any location except Papervision3D folder
  5. Click Finish

PAPERVISION3D

  1. Click Project
  2. Click Properties
  3. Select ActionScript Build Path
  4. Select Source path tab, then click Add Folder...
  5. Click Browse...
  6. Select Papervision3D folder, then
    • src or only Papervision3D if src folder was not included - .zip
    • as3\trunk\src - subversion client
  7. Click OK
  8. Click OK
  9. Click OK

AS

  1. Copy and paste code below
  2. Click File
  3. Click Save

RUN

  1. Click Run
  2. Click Run Example

ADOBE FLASH PROFESSIONAL

  1. Install Adobe Flash Professional
  2. Open Adobe Flash Professional

PAPERVISION3D

  1. Click Edit
  2. Click Preferences...
  3. Under Category, select ActionScript
  4. Click ActionScript 3.0 Settings...
  5. Click Add New Path (plus icon)
  6. Click Browse To Path (target icon)
  7. Select Papervision3D folder, then
    • src or only Papervision3D if src folder was not included - .zip
    • as3\trunk\src - subversion client
  8. Click OK
  9. Click OK
  10. Click OK

FLA

  1. Click File
  2. Click New...
  3. Select General tab
  4. Select Flash File (ActionScript 3.0)
  5. Click OK
  6. Click Window
  7. Click Properties
  8. Click Properties
  9. After Document Class:, type Example
  10. Click File
  11. Click Save
  12. After File name:, type Example.fla - any location except Papervision3D folder
  13. Click Save

AS

  1. Click File
  2. Click New...
  3. Select General tab
  4. Select ActionScript File
  5. Click OK
  6. Copy and paste code below
  7. Click File
  8. Click Save
  9. After File name:, type Example.as - same location as Example.fla
  10. Click Save

TEST

  1. Click Control
  2. Click Test Movie

FDT

  1. Install FDT
  2. Open FDT
  3. Close Welcome

PROJECT

  1. Click File
  2. Click New
  3. Click New Flash Project
  4. After Project name:, type Example - any location except Papervision3D folder
  5. Click Finish
  6. Click Window
  7. Click Show View
  8. Click Flash Explorer
  9. Under Flash Explorer, select Example

PAPERVISION3D

  1. Click Project
  2. Click Properties
  3. Select FDT Build Path
  4. Click Add Linked Libraries...
  5. Click Add...
  6. Click New...
  7. After Name:, type Papervision3D - or preferred name
  8. Click Folder...
  9. Select Papervision3D folder, then
    • src or only Papervision3D if src folder was not included - .zip
    • as3\trunk\src - subversion client
  10. Click OK
  11. Click OK
  12. Click OK
  13. Click Finish
  14. Click OK

AS

  1. Click File
  2. Click New
  3. Click Class
  4. After Source Folder:, type src
  5. After Class Name:, type Example
  6. Click Finish
  7. Copy and paste code below
  8. Click File
  9. Click Save

RUN

  1. Click Run
  2. Click Run
  3. Select FDT AS3 Application
  4. Click OK

FLASHDEVELOP

  1. Install Microsoft .NET Framework - 2.0+
  2. Install Java Runtime Environment - 1.6+
  3. Install Adobe Flash Player Debugger
  4. Install FlashDevelop
  5. Open FlashDevelop

AS3PROJ

  1. Click Project
  2. Click New Project...
  3. Under ActionScript 3, select Empty Project
  4. After Name:, type Example - any location except Papervision3D folder
  5. Click OK

PAPERVISION3D

  1. Click Project
  2. Click Properties...
  3. Under Classpaths tab, click Add Classpath...
  4. Select Papervision3D folder
    • Select as3\trunk\src folders in subversion client
    • Select src folder if src folder is included in .zip
  5. Click OK
  6. Click OK
  7. Click OK

AS

  1. Click File
  2. Click New...
  3. Click Blank Document
  4. Copy and paste code below
  5. Click File
  6. Click Save
  7. After File name:, type Example.as - same location as Example.as3proj
  8. Click Save
  9. Click View
  10. Click Project Manager
  11. Right-click Example.as
  12. Check Always Compile

SWF

  1. Click Project
  2. Click Properties...
  3. Under Output tab, after Output file:, type Example.swf - any location
  4. Click OK

TEST

  1. Click Project
  2. Click Test Movie

EXAMPLE

Install

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;
        }
    }
}

Download