简体   繁体   English

使用Nutiteq 3D SDK更改3D多边形的颜色

[英]Change Color for 3D Polygon with Nutiteq 3D SDK

I am trying to load the 3D polygons on the map. 我正在尝试在地图上加载3D多边形。 I am able to successfully load the 3d polygon but i am not able to define the color for polygon. 我能够成功加载3d多边形,但无法为多边形定义颜色。

     Polygon3DStyleBuilder polygon3DStyleBuilder = new Polygon3DStyleBuilder();
     polygon3DStyleBuilder.setColor(new Color(0xFF3333FF));
     Polygon3D polygon3D = new Polygon3D(polygon3DPoses, polygon3DHoles, polygon3DStyleBuilder.buildStyle(), 150);
   polygon3D.setMetaDataElement("ClickText", "3D Polygon");
  vectorDataSource.add(polygon3D);

As seen in the screen the side wall is in lighter color compared to the top one. 从屏幕上可以看到,与顶部相比,侧壁的颜色更浅。 Is there a way i can define different color for side walls and the top or the same color on both side? 有没有一种方法可以为侧壁和顶部定义不同的颜色,或者在两侧定义相同的颜色?

在此处输入图片说明

You may try setting the main light attributes as follows: 您可以尝试如下设置主要的灯光属性:

mapView.getOptions().setMainLight(new Color(1,1,1,1), new MapVec(0, 0, -1))

This will change the light direction to be from straight up. 这会将光的方向从直线向上改变。 The top will be lighter and sides darken, but all sides will have the same color. 顶部变浅,侧面变暗,但所有侧面的颜色相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM