Change line width on Cesium.RectangleOutlineGeometry

137 views
Skip to first unread message

nancyls...@gmail.com

unread,
Apr 2, 2020, 9:33:13 AM4/2/20
to cesium-dev
I am using Chrome 80 Windows 10 with Cesium 1.55.

My code draws a rectangle and then a rectangle outline.  I want the outline line thicker.  It is very thin.  Want a translucent rectangle with thicker outline.  Any suggestions.

    const instance = new Cesium.GeometryInstance({
      geometry: new Cesium.RectangleGeometry({
        rectangle: rect,
        vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
      }),
      attributes: {
        color: new Cesium.ColorGeometryInstanceAttribute.fromColor(color)
      }
    });

    const rectanglePrimitive = this.rectangleCollection.add(new Cesium.Primitive({     
      geometryInstances: instance,
      appearance: new Cesium.EllipsoidSurfaceAppearance({
        material: new Cesium.Material({
          fabric: {
            type: 'Color',
            uniforms: {
              color: color
            }
          }
        })
      }),
      asynchronous: false
    }));
    const outline = new Cesium.GeometryInstance({
      geometry: new Cesium.RectangleOutlineGeometry({
        rectangle: this.rectangle,
        vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
      }),
      attributes: {
        color: new Cesium.ColorGeometryInstanceAttribute.fromColor(color),
      }
    });
    const outlinePrimitive = this.rectangleCollection.add(new Cesium.Primitive({
      geometryInstances: outline,
      appearance: new Cesium.PerInstanceColorAppearance({
        closed: true,
        translucent : false,
        renderState : {
          depthTest : {
              enabled : true
          },
          lineWidth : Math.min(4.0, this.geoIntViewer.scene.maximumAliasedLineWidth)  ===>  I made this number bigger and no changes?
        }
      })
    }));



Omar Shehata

unread,
Apr 2, 2020, 3:41:57 PM4/2/20
to cesium-dev
Setting line thickness isn't supported on Windows. See details here: https://github.com/CesiumGS/cesium/issues/8577
Reply all
Reply to author
Forward
0 new messages