I have a flash application and I use papervision3d library. I put my objects to the scene, no problem but I also want to show the coordinate axes (x,y and z) to user. Is there any way to show these axes?

有帮助吗?

解决方案

That would be the UCS object:

scene.addChild(new UCS());

Here's a very basic example:

package {
    import flash.display.Sprite;
    import flash.events.Event;
    import org.papervision3d.view.*;
    import org.papervision3d.objects.*;
    import org.papervision3d.objects.primitives.*;
    import org.papervision3d.objects.special.*;

    public class HelloPV3D extends Sprite {

        private var view:BasicView;

        public function HelloPV3D()  {
            view = addChild(new BasicView()) as BasicView;
            view.scene.addChild(new UCS());
            view.scene.addChild(new Sphere());
            this.addEventListener(Event.ENTER_FRAME,update);
        }
        private function update(e:Event):void{
            view.camera.orbit(mouseY/stage.stageHeight,mouseX/stage.stageWidth,false);
            view.singleRender();
        }
    }
}

UCS Demo

其他提示

Of course there is. I wrote a class called Trident3D that represents the coordinate axes. Click here to see article about it or download the demo that contains the source code.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top