HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

1

Start with a scene, camera, viewport, and renderer.

Scene is the container.

Camera is the point of view.

Viewport is the area to render.

Renderer renders the data.

Note: Nothing is rendered in this step.

Example

1

Instructions

  1. Import scene, camera, viewport, and renderer classes
    import org.papervision3d.cameras.Camera3D;
    import org.papervision3d.render.BasicRenderEngine;
    import org.papervision3d.scenes.Scene3D;
    import org.papervision3d.view.Viewport3D;
  2. Declare scene, camera, viewport, and renderer
    private var scene    :Scene3D;
    private var camera   :Camera3D;
    private var viewport :Viewport3D;
    private var renderer :BasicRenderEngine;
  3. Initialize scene
    scene = new Scene3D();
  4. Initialize camera
    camera = new Camera3D();
  5. Initialize and add viewport
    viewport = new Viewport3D();
    addChild(viewport);
  6. Initialize renderer
    renderer = new BasicRenderEngine();
  7. Render - nothing is rendered in this step
    renderer.renderScene(scene, camera, viewport);

Code

package
{
    import flash.display.Sprite;

    import org.papervision3d.cameras.Camera3D;
    import org.papervision3d.render.BasicRenderEngine;
    import org.papervision3d.scenes.Scene3D;
    import org.papervision3d.view.Viewport3D;

    public class Papervision3D1 extends Sprite
    {
        private var scene    :Scene3D;
        private var camera   :Camera3D;
        private var viewport :Viewport3D;
        private var renderer :BasicRenderEngine;

        public function Papervision3D1()
        {
            scene = new Scene3D();

            camera = new Camera3D();

            viewport = new Viewport3D();
            addChild(viewport);

            renderer = new BasicRenderEngine();

            renderer.renderScene(scene, camera, viewport);
        }
    }
}

Download