Skip to content
New issue

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

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

Already on GitHub? # to your account

The camera rotates below the ground #7741

Closed
ZhangGuangXin opened this issue Apr 12, 2019 · 2 comments
Closed

The camera rotates below the ground #7741

ZhangGuangXin opened this issue Apr 12, 2019 · 2 comments

Comments

@ZhangGuangXin
Copy link

ZhangGuangXin commented Apr 12, 2019

In cesium version 1.56.1, camera. Lookat() function is used to rotate the camera around a target, but the camera rotates down to the ground. I didn't use terrain, I used 3d tiles data.

Excese me, How to solve this problem?

image

@shortwavedave
Copy link

I think I have a similar issue - I registered it with the angular-cesium repo (articodeltd/angular-cesium#262), but they think this is a cesium issue.

Intended outcome:

Draw corridors with terrain enabled

Actual outcome:

The corridors are misaligned and change with the view, the georeference of the corridor appears incorrect relative to the aerial image. If I disable terrain, then it works fine.

How to reproduce the issue:

create a map with terrain provider by cesium ion, e.g.:

export class MapLayerComponent {
  sceneMode = SceneMode.SCENE3D;
  MapLayerProviderOptions = MapLayerProviderOptions;
  arcGisMapServerProvider = MapLayerProviderOptions.ArcGisMapServer;
  @ViewChild(AcLayerComponent) layer: AcLayerComponent;

  constructor(private viewerConf: ViewerConfiguration, public appSettingsService: AppSettingsService) {
    viewerConf.viewerOptions = {
      selectionIndicator: false,
      timeline: false,
      infoBox: false,
      fullscreenButton: false,
      animation: false,
      shouldAnimate: false,
      homeButton: false,
      geocoder: true,
      navigationHelpButton: false,
      navigationInstructionsInitiallyVisible: false,
      baseLayerPicker: false,
    };

    viewerConf.viewerModifier = (viewer: any) => {
      viewer.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
      viewer.imageryProvider = new Cesium.createWorldImagery({
        style : Cesium.IonWorldImageryStyle.AERIAL_WITH_LABELS
      });
      viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
        url: Cesium.IonResource.fromAssetId(1),
      });
      this.appSettingsService.showRoadsLayer = true;
    };
  }
} 

Create a corridor, e.g.:

  <ac-corridor-desc props="{
    name: entity.name,
    positions: entity.positions,
    width : 10,
    extrudedHeight : 100,
    height : 400,
    material : Cesium.Color.BLUE.withAlpha(0.1),
    outline : true,
  }">
  </ac-corridor-desc>

@OmarShehata
Copy link
Contributor

Thanks for bringing this up - I believe this is the same issue as #5837.

For @shortwavedave , it's hard to tell without seeing it, but I think this is an issue of depth testing against terrain being turned off. Please try turning it on with:

viewer.scene.globe.depthTestAgainstTerrain = true;

If that doesn't fix it, please open a new issue with a Sandcastle code example of the issue.

@hpinkos hpinkos closed this as completed May 20, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants