简体   繁体   中英

Change Color for 3D Polygon with Nutiteq 3D SDK

I am trying to load the 3D polygons on the map. I am able to successfully load the 3d polygon but i am not able to define the color for polygon.

     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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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