zoukankan      html  css  js  c++  java
  • cesium中的四种拾取pick

    cesium中有好多种物体拾取,在这里记录一下,方便查阅。

    1、viewer.scene.pick(windowPosition);
      官网介绍:

    Returns an object with a `primitive` property that contains the first (top) primitive in the scene at a particular window coordinate or undefined if nothing is at the location. 
    Other properties may potentially be set depending on the type of primitive and may be used to further identify the picked object.
    When a feature of a 3D Tiles tileset is picked, pick returns a Cesium3DTileFeature object

      返回scene中指定位置的顶端的primitive属性的的一个对象。
      适用于选取3D tiles,改变3Dtiles的属性,比如颜色等。

    2、 viewer.scene.globe.pick(ray, viewer.scene);

      其中 var ray = viewer.camera.getPickRay(movement.position);

      官网介绍:

    Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
    

      返回y一个ray和地球表面的一个交点的Cartesian3坐标。

      适用于拾取有地形高程的点,但不包括模型、倾斜摄影等表面高度。需要开启深度测试 depthTestAgainstTerrain = true。

    3、viewer.scene.camera.pickEllipsoid(movement.position, ellipsoid);

      官网介绍:

    Pick an ellipsoid or map.
    Returns:
    If the ellipsoid or map was picked, returns the point on the surface of the ellipsoid or map in world coordinates. If the ellipsoid or map was not picked, returns undefined.
    

      返回的是椭圆球体表面的一个Cartesian3坐标。

      适用于裸球表面的选取,是基于数学模型的椭圆球体。

    4、viewer.scene.pickPosition(movement.position);

      官网介绍:

    Returns the cartesian position reconstructed from the depth buffer and window position.
    

      返回一个被屏幕坐标和深度缓存指定的点。

      适用于模型表面位置的选取,通俗的说就是camera看过去第一个被挡住的模型(如entity)上的坐标,通常结合其他的选取方式一块用于选取模型和球上的点。

      

      

    .
  • 相关阅读:
    AX 2012 Form and Parts
    AX 2012 SSRS print setting-报表打印输出设置
    AX 2012 关于parts 添加
    AX Dynamic 2012 tabletype:TempDB使用
    AX Dynamic 2012 SSRS 按行数分页
    AX Dynamic 2012 SSRS autorepot中取当前公司名、打印时间、打印页码
    AX Dynamics 去中文字符长度:中文字符当2个字符处理
    AX dynamics 2012 ssrs 开发报错:Native compiler return value: ‘[BC30179]
    在Ubuntu 下编译c语言
    在ubuntu加载flash的方法
  • 原文地址:https://www.cnblogs.com/airduce/p/14663927.html
Copyright © 2011-2022 走看看