Menu
Riverview Church

UCS

UCS is a coordinate system displaying the x, y, and z axes.

EXAMPLE

UCS

INSTRUCTIONS

  1. Import import org.papervision3d.objects.special.UCS;
  2. Declare private var object :UCS;
  3. Initialize object = new UCS(scale, name);
    PARAMETER DEFAULT DESCRIPTION
    scale 500 scale
    name null name
  4. Add scene.addChild(object);

CODE

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

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

    public class Papervision3DUCS extends Sprite
    {
        private var scene    :Scene3D;
        private var camera :Camera3D;
        private var viewport :Viewport3D;
        private var renderer :BasicRenderEngine;
        private var object :UCS;
        private var angle    :int = 0;

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

            camera = new Camera3D();

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

            renderer = new BasicRenderEngine();

            object = new UCS();
            scene.addChild(object);

            addEventListener(Event.ENTER_FRAME, handleEnterFrame);
        }

        private function handleEnterFrame(e:Event):void
        {
            camera.orbit(90, angle++);

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

Download

Papervision3D Official Documentation