https://cesium.com/docs/cesiumjs-ref-doc/Camera.html?classFilter=camera

文章目录

  • 应用场景
  • Camera模块介绍
  • Members
  • Methods
    • flyTo(options)
      • destination
      • orientation
      • Example
      • Throws:
      • maximumHeight
      • pitchAdjustHeight
      • flyOverLongitude
      • else properties

应用场景

Camera模块介绍

new Cesium.Camera(scene)
Scene/Camera.js 63
The camera is defined by a position, orientation, and view frustum.

(视锥体(frustum),是指场景中摄像机的可见的一个锥体范围。它有上、下、左、右、近、远,共6个面组成。在视锥体内的景物可见,反之则不可见。)

The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.

The viewing frustum is defined by 6 planes. Each plane is represented by a Cartesian4 object, where the x, y, and z components define the unit vector normal to the plane, and the w component is the distance of the plane from the origin/camera position.

Name Type Description
scene Scene The scene
// Create a camera looking down the negative z-axis, positioned at the origin,
// with a field of view of 60 degrees, and 1:1 aspect ratio.
var camera = new Cesium.Camera(scene);
camera.position = new Cesium.Cartesian3();
camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
camera.frustum.near = 1.0;
camera.frustum.far = 2.0;

Members

Methods

flyTo(options)

Flies the camera from its current position to a new position.
Name:options
Type:Object
Description:Object with the following properties:

destination

Type:Cartisian3,Rectangle
The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.

orientation

Type:object
An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.

Example

// 1. Fly to a position with a top-down view
viewer.camera.flyTo({destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
});// 2. Fly to a Rectangle with a top-down view
viewer.camera.flyTo({destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
});// 3. Fly to a position with an orientation using unit vectors.
viewer.camera.flyTo({destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),orientation : {direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)}
});// 4. Fly to a position with an orientation using heading, pitch and roll.
viewer.camera.flyTo({destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),orientation : {heading : Cesium.Math.toRadians(175.0),pitch : Cesium.Math.toRadians(-35.0),roll : 0.0}
});

Throws:

DeveloperError : If either direction or up is given, then both are required.

maximumHeight

Type:Number
The maximum height at the peak of the flight.

pitchAdjustHeight

Type:Number
If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.

flyOverLongitude

Type:Number
There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.

else properties

duration
The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.
complete
The function to execute when the flight is complete.
cancel
The function to execute if the flight is cancelled.
endTranform
Transform matrix representing the reference frame the camera will be in when the flight is completed.
flyOverLongitudeWeight
Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
convert
Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to true.
easingFunction
Controls how the time is interpolated over the duration of the flight.

Cesium-Camera-flyto详解相关推荐

  1. Cocos 技术派 05 | Camera 摄像机详解

    往期技术派文章: 第01期<野蛮人大作战>从开发到上线 第02期 Cocos Creator 2.0 摄像机的灵活运用 第03期 插件推荐 CC_inspector + 第04期 实时竞技 ...

  2. HTML中的camera标签,详解HTML5 使用video标签实现选择摄像头功能

    详解HTML5 使用video标签实现选择摄像头功能 1. html // jquery reference // // Open WebCam Snap Photo 2. javascript El ...

  3. 【CG】针孔相机矩阵(Camera Matrix)详解

    0. 相机矩阵 Camera Matrix 小孔成像模型 成像过程 1. 相机矩阵的分解 齐次坐标下,物体的物理坐标是 [x,y,z,1]′ [ x , y , z , 1 ] ′ [x,y,z,1] ...

  4. Unity3D摄像机Camera参数详解

    做项目遇到了摄像机的相关问题,故此来学习并记录下. (Unity2017.4.2) 1.Clear Flags:清除标记.决定屏幕的哪部分将被清除.一般用户使用对台摄像机来描绘不同游戏对象的情况,有3 ...

  5. Babylonjs 基础教程与填坑③sandbox沙盒、inspector调试器操作教程【新手必看】和Camera类详解

    简单介绍,无论是webgl程序员还是3D美术,都必须要学会用sandbox和inspector 提高团队效率的必备工具 例如模型师导出的gltf.glb模型,程序员通过代码加载模型,部署运行后才发现碎 ...

  6. Cesium 核心类Viewer-查看器详解

    Cesium 核心类Viewer-查看器详解 1 简介 A base widget for building applications. It composites all of the standa ...

  7. Cesium 事件详解(鼠标事件、相机事件、键盘事件、场景触发事件)

    Cesium 事件详解(鼠标事件.相机事件.键盘事件.场景触发事件) 1 Cesium中的事件 根据使用情况,我把Cesium中的事件大体分为三种,即屏幕空间事件处理程序,屏幕空间相机控制器,场景触发 ...

  8. Cesium调用高德地图服务实现搜索地点定位详解

    一.需求分析 需要做一个类似于高德地图的搜索可以参考高德地图,用户输入地点,下拉列表自动弹出少量的相应地点,点击内容地点可以直接选择定位并且添加Cesium的广告牌(图标)和标注,点击标注可以弹出详细 ...

  9. 虚拟摄像头之五: 详解 android8 的 Camera 子系统框架

    前言 由于 android 版本差异. camera子系统框架也有不同调整,本文是采用 android8 源码作为参考对象,对 camera 子系统进行框架梳理, 建立起框架性认知后.在进一步分析各模 ...

  10. android camera 3d特效 详解与进阶

    1 概述 本篇主要讲解camera,这里的camera并不是照相相关的类,而是android.graphics.Camera,这个类中封装了一个matrix,不熟悉的同学可以看前面的文章来了解.and ...

最新文章

  1. 某高校教授要求:博士生发表论文,必须把他列为第一作者
  2. 同一服务器上多个版本的 sqlserver ,如何连接,改变某一实例的端口号
  3. cmake (0)简介
  4. 逆向入门--代码段的介绍
  5. SAP Spartacus focus directive tabindex的默认值设置
  6. 如何查看/统计当前AD域控制器的活动用户
  7. 2017java面试_2017 Java面试大全(一)
  8. Hyperledger Fabric教程(13)-- 集成CouchDB作为状态数据库
  9. [搜片神器]服务器SQL2005查询分页语句你理解了么
  10. python装饰器举例_Python学习笔记:装饰器(Decorator)
  11. 《穿越计算机的迷雾》第一版说明
  12. 机械硬盘与互联网文明
  13. 数学基础知识总结 —— 12. 求极限的重要工具「洛必达法则」
  14. 用AI引导人类直觉促进数学发展 【DeepMind Nature2021.12.1】
  15. 分布式事务 java代码_Java分布式事务概念与实现示例
  16. pos机显示服务器异常,POS机刷卡出现异常不要慌!一定要按步骤处理问题!
  17. 微信网页授权接口 对象存储
  18. MATLAB学习笔记(二)——数据及其运算
  19. 华泰证券 python 自动交易_tushare开源股票交易接口基于python实现技术
  20. 苹果Mac电脑怎么卸载软件?

热门文章

  1. 我为什么放弃java学习Kotlin?
  2. linux自动登录drcom,Ubuntu用drcom客户端登陆
  3. 【科研工具】在科研人的浏览器里,多个插件多条路。
  4. Vue-Lazyload学习文档
  5. VR全景图片浏览实现
  6. linux安装android x86_64,在VirtualBox上安装Android-X86
  7. 什么是安全漏洞扫描?
  8. 「游戏」岩浆逃脱2.1
  9. ROS机器人的远程启动和控制过程
  10. mqtt服务器(mosquitto)测试环境的搭建