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

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);
    ParameterDefaultDescription
    scale500scale
    namenullname
  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

HomeMenu