문제

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