3D Tiles 介绍(三)

本文介绍了3D Tiles的Viewer request volume概念,展示了如何通过tileset.json文件组织和管理异构数据集。通过示例解释了如何使用boundingVolume和viewerRequestVolume控制瓦片的渲染与请求。同时,详细解析了tileset.json文件的结构,包括asset、properties、geometricError和root等关键属性,以及它们在3D场景中的作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文地址:点击打开链接

Viewer request volume 视景器请求体

A tile's viewerRequestVolume can be used for combining heterogeneous datasets, and can be combined with external tilesets.

一个瓦片的viewerRequestVolume可用于兼容异构数据集和外部瓦片集。

The following example has a building in a b3dm tile and a point cloud inside the building in a pnts tile. The point cloud tile's boundingVolume is a sphere with a radius of 1.25. It also has a larger sphere with a radius of 15 for the viewerRequestVolume. Since the geometricError is zero, the point cloud tile's content is always rendered (and initially requested) when the viewer is inside the large sphere defined by viewerRequestVolume.

下面的示例中有一个建筑物在b3dm文件中,一个建筑物中的点云在pnts文件中。点云瓦片的boundingVolume是一个半径1.25的球,它还有一个半径15的球作为viewerRequestVolume。由于geometricError的值为0,当视景器进入viewerRequestVolume定义的较大球体时,点云数据从最初请求开始一直被渲染出来。

"children": [{
  "transform": [
     4.843178171884396,   1.2424271388626869, 0,                  0,
    -0.7993325488216595,  3.1159251367235608, 3.8278032889280675, 0,
     0.9511533376784163, -3.7077466670407433, 3.2168186118075526, 0,
     1215001.7612985559, -4736269.697480114,  4081650.708604793,  1
  ],
  "boundingVolume": {
    "box": [
      0,     0,    6.701,
      3.738, 0,    0,
      0,     3.72, 0,
      0,     0,    13.402
    ]
  },
  "geometricError": 32,
  "content": {
    "url": "building.b3dm"
  }
}, {
  "transform": [
     0.968635634376879,    0.24848542777253732, 0,                  0,
    -0.15986650990768783,  0.6231850279035362,  0.7655606573007809, 0,
     0.19023066741520941, -0.7415493329385225,  0.6433637229384295, 0,
     1215002.0371330238,  -4736270.772726648,   4081651.6414821907, 1
  ],
  "viewerRequestVolume": {
    "sphere": [0, 0, 0, 15]
  },
  "boundingVolume": {
    "sphere": [0, 0, 0, 1.25]
  },
  "geometricError": 0,
  "content": {
    "url": "points.pnts"
  }
}]

tileset.json

tileset.json文件

tileset.json defines a tileset. Here is a subset of the tileset.json used for Canary Wharf (also see the complete tileset.json):

tileset.json定义一个瓦片集。下面是Canary Wharf的tileset.json文件中一部分:

{
  "asset" : {
    "version": "0.0",
    "tilesetVersion": "e575c6f1-a45b-420a-b172-6449fa6e0a59",
    "gltfUpAxis": "Y"
  },
  "properties": {
    "Height": {
      "minimum": 1,
      "maximum": 241.6
    }
  },
  "geometricError": 494.50961650991815,
  "root": {
    "boundingVolume": {
      "region": [
        -0.0005682966577418737,
        0.8987233516605286,
        0.00011646582098558159,
        0.8990603398325034,
        0,
        241.6
      ]
    },
    "geometricError": 268.37878244706053,
    "content": {
      "url": "0/0/0.b3dm",
      "boundingVolume": {
        "region": [
          -0.0004001690908972599,
          0.8988700116775743,
          0.00010096729722787196,
          0.8989625664878067,
          0,
          241.6
        ]
      }
    },
    "children": [..]
  }
}

The top-level object in tileset.json has four properties: asset, properties, geometricError, and root.

tileset.json的顶级对象有四个属性:assetpropertiesgeometricErrorroot

asset is an object containing properties with metadata about the entire tileset. Its version property is a string that defines the 3D Tiles version. The version defines the JSON schema for tileset.json and the base set of tile formats. The tilesetVersion property is an optional string that defines an application-specific version of a tileset, e.g., for when an existing tileset is updated. The gltfUpAxis property is an optional string that specifies the up-axis of glTF models contained in the tileset.

asset对象包含整个瓦片集元数据属性,它的version属性是一个定义3D Tiles版本的字符串。版本定义了tileset.json的JSON模式和瓦片格式的基本集合。tilesetVersion是一个可选的字符串属性,定义瓦片集的专业版本号,例如用于当前瓦片集更新时。gltfUpAxis属性是一个可选的字符串属性,指定瓦片集中glTF模型的向上坐标轴。

properties is an object containing objects for each per-feature property in the tileset. This tileset.json snippet is for 3D buildings, so each tile has building models, and each building model has a Height property (see Batch Table). The name of each object in properties matches the name of a per-feature property, and defines its minimum and maximum numeric values, which are useful, for example, for creating color ramps for styling.

properties是一个对象,包含了瓦片集中每一个要素属性对象。上述tileset.json片段是针对3D建筑物的,所以每个瓦片都有建筑物模型,每个建筑物模型都有Height属性。properties属性中每个对象的名字都和要素属性的名字相匹配,并且定义了它的minimum最小和maximum最大数值,用于为样式创建色带时。

geometricError is a nonnegative number that defines the error, in meters, when the tileset is not rendered.

geometricError属性是一个非负数字,定义了一个以米为单位的误差,在这个误差下瓦片集不被渲染。

root is an object that defines the root tile using the JSON described in the above section. root.geometricError is not the same as tileset.json's top-level geometricError. tileset.json's geometricError is the error when the entire tileset is not rendered; root.geometricError is the error when only the root tile is rendered.

root是一个定义根瓦片的对象。root.geometricError与tileset.json中顶层geometricError不同。后者是整个瓦片集不被渲染的误差,前者是只有根瓦片被渲染的误差。

root.children is an array of objects that define child tiles. Each child tile has a boundingVolume fully enclosed by its parent tile's boundingVolume and, generally, a geometricError less than its parent tile's geometricError. For leaf tiles, the length of this array is zero, and children may not be defined.

root.children是定义子瓦片的对象数组。每个子瓦片都有一个被其父瓦片boundingVolume包围的boundingVolume和一个通常小于父瓦片geometricErrorgeometricError。对于叶子瓦片root.children的长度是0,children可能未定义。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值