///<summary>动画移动相机查看指定位置, 按原始坐标, yjd为原始坐标的Y值, timerFactor: 速度系数, 为0则无动画直接刷新</summary> public void aniLook(double yjd, double xwd, double gd, double speedFactor = 1) { System.Windows.Point pnt = new System.Windows.Point(xwd, yjd); if (earth.coordinateManager.Enable) { pnt = earth.coordinateManager.transToInner(pnt); //若启用了坐标转换 yjd = pnt.Y; xwd = pnt.X; } Vector3 tmp = Helpler.JWHToPoint(yjd, xwd, gd, earth.earthManager.earthpara); aniLook(new VECTOR3D(tmp.X, tmp.Y, tmp.Z), speedFactor); }
///<summary>初始化相机到指定位置</summary> public void initCamera(double jd, double wd, double gd) { if (earth.coordinateManager.Enable) { //System.Windows.Point pnt = earth.coordinateManager.transToInner(new System.Windows.Point(wd, jd)); //若激活了坐标转换,转换为内部坐标 System.Windows.Point pnt = earth.coordinateManager.transToInner(new System.Windows.Point(jd, wd)); //若激活了坐标转换,转换为内部坐标 jd = pnt.Y; wd = pnt.X; } cameraPosition = Helpler.JWHToPoint(jd, wd, gd, earth.earthManager.earthpara); if (earth.earthManager.earthpara.SceneMode == ESceneMode.地球) { cameraLookat = new Vector3(0, 0, 0); } else { cameraLookat = Helpler.JWHToPoint(jd, wd, 0, earth.earthManager.earthpara); } cameraDirection = cameraLookat - cameraPosition; cameraDirection.Normalize(); calCameraByDirection(); }
///<summary>动画移动相机查看指定位置, 按经纬坐标, timerFactor: 速度系数, 为0则无动画直接刷新</summary> public void aniLookGeo(double yjd, double xwd, double gd, double speedFactor = 1) { Vector3 tmp = Helpler.JWHToPoint(yjd, xwd, gd, earth.earthManager.earthpara); aniLook(new VECTOR3D(tmp.X, tmp.Y, tmp.Z), speedFactor); }