Hi,
I've been working on an interactive extent selection mechanism in
Cesium. It seems to be working ok now though I've noticed a couple of
rendering issues on large polygons/polylines (see attached images).
In case they haven't been reported they are as follows...
- In 3d view polylines take a path through the earth, whereas polygons
curve with the ellipsoid
- In 2d view the polyline behaves, but the polygon has bent edges
I'm hoping to work around this for now by adding intermediate points
along edges rather than just specifying corners.
btw Is there a way to temporarily disable navigation? For now I've
resorted to removing all camera controllers while selection is taking
place then adding back in afterwards.
Cheers,
Chris
// should be able to repro in current version of terrain branch with
something like...
var west = Cesium.Math.toRadians(109.0);
var south = Cesium.Math.toRadians(-45.0);
var east = Cesium.Math.toRadians(157.0);
var north = Cesium.Math.toRadians(-8.0);
var extent = new Cesium.Extent(west, south, east, north);
scene.viewExtent(extent, Cesium.Ellipsoid.WGS84);
var polylines = new Cesium.PolylineCollection();
pts = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray([
new Cesium.Cartographic(west, south),
new Cesium.Cartographic(west, north),
new Cesium.Cartographic(east, north),
new Cesium.Cartographic(east, south),
new Cesium.Cartographic(west, south)]);
polylines.add({positions: pts});
scene.getPrimitives().add(polylines);
var poly = new Cesium.Polygon();
poly.material.uniforms.color = new Cesium.Color(1.0, 0.5, 0.0, 0.6);
poly.setPositions(pts);
poly.affectedByLighting = false;
scene.getPrimitives().add(poly);