AnsweredAssumed Answered

Set camera looking at point without specifying heading or pitch

Question asked by jasonMDSP on Aug 6, 2015
Latest reply on Aug 24, 2015 by jasonMDSP

Is there a way to set the camera looking at a specific point in the scene without specifying a heading or pitch explicitly? I found a how to calculate pitch and heading using the haversine formula, but I was wondering if ArcGIS could do this for me. I want something similar to this:

 

Esri.ArcGISRuntime.Geometry.MapPoint mapPoint1 = new Esri.ArcGISRuntime.Geometry.MapPoint(cameraX, cameraY, cameraAlt);
Esri.ArcGISRuntime.Geometry.MapPoint mapPoint2 = new Esri.ArcGISRuntime.Geometry.MapPoint(targetX, targetY, targetAlt);

Esri.ArcGISRuntime.Controls.Camera camera = new Camera(mapPoint1,0,0);
//or
//Esri.ArcGISRuntime.Controls.Camera camera = new Camera(mapPoint1,calculatedHeading,calculatedPitch); 
Viewpoint vp = new Viewpoint(camera, mapPoint2); //camera looks at mapPoint2

MySceneView.SetView(vp);

 

Thanks.

Outcomes