Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleOutlineGeometry appears as cylinder #2499

Closed
gberaudo opened this issue Feb 18, 2015 · 2 comments · Fixed by #2526
Closed

CircleOutlineGeometry appears as cylinder #2499

gberaudo opened this issue Feb 18, 2015 · 2 comments · Fixed by #2526

Comments

@gberaudo
Copy link
Contributor

Hello,

The following Sandcastle code used to display a floating circle.
However in 1.6 and master, a cylinder appears.
This issue seems related to the packing changes.

var viewer = new Cesium.Viewer('cesiumContainer');
var primitives = viewer.scene.primitives;

var center = new Cesium.Cartesian3(
    2930859.8012761218,
    2922254.5933887595,
    5476485.915141216
);


var radius = 648236;
var height = 500000;


var outlineGeometry = new Cesium.CircleOutlineGeometry({
  center: center,
  radius: radius,
  height: height
});

var outColor = { red: 1, green: 0, blue: 0, alpha: 1 };


var createColoredPrimitive = function(geometry, color) {
  var createInstance = function(geometry, color) {
    return new Cesium.GeometryInstance({
      // always update Cesium externs before adding a property
      geometry: geometry,
      attributes: {
        color: Cesium.ColorGeometryInstanceAttribute.fromColor(color)
      }
    });
  };

  var options = {
    // always update Cesium externs before adding a property
    flat: true // work with all geometries
  };

  var appearance = new Cesium.PerInstanceColorAppearance(options);

  var instances = createInstance(geometry, color);

  var primitive = new Cesium.Primitive({
    // always update Cesium externs before adding a property
    geometryInstances: instances,
    appearance: appearance
  });

  return primitive;
};

primitives.add(createColoredPrimitive(outlineGeometry, outColor));
@mramato
Copy link
Contributor

mramato commented Feb 18, 2015

Thanks for the report. That's definitely a bug. The workaround for now is to add extrudedHeight : height as a parameter to the geometry. We'll definitely get this fixed for 1.7

@gberaudo
Copy link
Contributor Author

Thanks @mramato for the workaround.

gberaudo added a commit to gberaudo/ol3-cesium that referenced this issue Feb 19, 2015
mramato added a commit that referenced this issue Mar 1, 2015
`extrudedHeight` was getting defaulted to `0` during the pack/unpack
process, which caused asynchronous geometry to be extruded when it should
have just been at height.

Fixes #2499
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants