WorldWind PointPlacemark Heading

后端 未结 2 2144
梦毁少年i
梦毁少年i 2021-02-15 12:37

In NASA WorldWind Java, I\'m using PointPlacemark to represent an image because it stays the same size regardless of zoom level. The problem is that I want to set the heading o

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-15 13:32

    What you want to achieve is scale your polygon based on the eye position of the camera, and keep the polygon oriented on the map.

    You could try to update your second solution and add a RenderingListener ro update the size of your polygon before rendering:

    wwd.addRenderingListener(new RenderingListener()
    {
        public void stageChanged(RenderingEvent event)
        {
            if (RenderingEvent.BEFORE_RENDERING.equals(event.getStage())
            {
                 if (wwd.getView() != null && wwd.getView().getEyePosition() != null) {
                     // compute distance between eyePosition and object position, and set the scale.
                 }
    
            }
        }
    });
    

提交回复
热议问题