Change Color for 3D Polygon with Nutiteq 3D SDK

117 Views Asked by At

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?

enter image description here

1

There are 1 best solutions below

1
MarkT On

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.