首页 / 浏览问题 / 三维GIS / 问题详情
想在三维平面场景中画圆并实现拉伸,有相关示例吗?
24EXP 2017年07月24日
基于iserver的二次开发,需求想在三维平面场景中画圆,并实现拉伸效果,请问有相关示例吗?或者应使用什么方式实现?

1个回答

您好,您是要做iServer iClient for 3D plugin的开发?还是 做webGL开发?
11EXP 2017年07月24日
iServer iClient for 3D plugin开发,场景为平面场景,

onMouseMove: function (e) {
                    if (isDrawing && point3D != null) {
                        var pnt1 = point3D;
                        var pt = new SuperMap.Pixel(e.get_clientX(), e.get_clientY());
                        var tempPoint = this._sceneControl.pixelToGlobe(pt, SuperMap.Web.Realspace.PixelToGlobeMode.TerrainAndModel);

                        //var point1=pointConverter(pnt1);
                        //var point2=pointConverter(tempPoint);
                        //var R=Math.sqrt(Math.pow((point1.x-point2.x),2)+Math.pow((point1.y-point2.y),2));
                        R=Math.sqrt(Math.pow((point3D.x-tempPoint.x),2)+Math.pow((point3D.y-tempPoint.y),2));

                        var GeoCircle3D = new SuperMap.Web.Core.GeoCircle3D(R);
                        GeoCircle3D.set_position(pnt1);
                        var GeoModel = new SuperMap.Web.Core.GeoModel();
                        GeoModel=GeoCircle3D.getGeoModel(100,100);                        

                        var feature = new SuperMap.Web.Core.Feature3D();
                        feature.set_geometry(GeoModel);
                        var style = new SuperMap.Web.Core.Style3D();
                        style.set_fillForeColor(new SuperMap.Web.Core.Color(255, 0, 0, 180));
                        style.set_lineColor(new SuperMap.Web.Core.Color(0, 0, 255, 100));
                        style.set_lineWidth(1);
                        style.set_altitudeMode(0);
                        style.set_extendHeight(10);
                        feature.set_style3D(style);
                        this._sceneControl.get_scene().get_trackingLayer3D().removeAll(); //删除跟踪图层上的图像
                        this._sceneControl.get_scene().get_trackingLayer3D().add(feature, "GeoCircle3D");
                        this._sceneControl.get_scene().get_trackingLayer3D().refresh();
                    }
                }

现在通过这种方式能够进行圆的绘制了,可是style.set_extendHeight(10);设置了却无法进行拉伸。我想请教一下这么画圆的方式可以吗,另外拉伸属性如何实现,谢谢!
...