Menu
Riverview Church

LAZYRENDERENGINE

LazyRenderEngine renders the data.

It renders one scene, one camera, and one viewport.

EXAMPLE

LazyRenderEngine

INSTRUCTIONS

  1. Import import org.papervision3d.render.LazyRenderEngine;
  2. Declare private var renderer :LazyRenderEngine;
  3. Initialize renderer = new LazyRenderEngine(scene, camera, viewport);
    PARAMETER DEFAULT DESCRIPTION
    scene NONE container
    camera NONE point of view
    viewport NONE area to render
  4. Render renderer.render();

CODE

´╗┐package
{
    import flash.display.Sprite;
    import flash.events.Event;

    import org.papervision3d.cameras.Camera3D;
    import org.papervision3d.materials.ColorMaterial;
    import org.papervision3d.objects.primitives.Plane;
    import org.papervision3d.render.LazyRenderEngine;
    import org.papervision3d.scenes.Scene3D;
    import org.papervision3d.view.Viewport3D;

    public class Papervision3DLazyRenderEngine extends Sprite
    {
        private var scene    :Scene3D;
        private var camera :Camera3D;
        private var viewport :Viewport3D;
        private var renderer :LazyRenderEngine;
        private var material :ColorMaterial;
        private var object :Plane;

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

            camera = new Camera3D();

            viewport                 = new Viewport3D();
            viewport.autoScaleToStage = true;
            addChild(viewport);

            renderer = new LazyRenderEngine(scene, camera, viewport);

            material             = new ColorMaterial(0x000000);
            material.doubleSided = true;

            object = new Plane(material);
            scene.addChild(object);

            addEventListener(Event.ENTER_FRAME, handleEnterFrame);
        }

        private function handleEnterFrame(e:Event):void
        {
            object.yaw(1);

            renderer.render();
        }
    }
}

Download

Papervision3D Official Documentation