diff --git a/extensions/2.0/Vendor/EXT_implicit_cylinder_region/README.md b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/README.md index 3989bd2bec..0d8f32b32f 100644 --- a/extensions/2.0/Vendor/EXT_implicit_cylinder_region/README.md +++ b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/README.md @@ -11,11 +11,11 @@ Draft ## Dependencies -Written against the glTF 2.0 specification. +Written against the glTF 2.0 specification. Depends on the [`KHR_implicit_shapes`](https://github.com/eoineoineoin/glTF/tree/refs/heads/collisionShapeMerge/extensions/2.0/Khronos/KHR_implicit_shapes) extension. ## Overview -This extension defines a cylinder-conforming region as an additional shape type for the [`KHR_implicit_shapes`](https://github.com/eoineoineoin/glTF/tree/refs/heads/collisionShapeMerge/extensions/2.0/Khronos/KHR_implicit_shapes) extension. These regions are useful for visualizing real-world data that has been captured by cylindrical sensors. +This extension defines a cylinder-conforming region as an additional shape type for the `KHR_implicit_shapes` extension. These regions are useful for visualizing real-world data that has been captured by cylindrical sensors. `EXT_implicit_cylinder_region` extends the `shape` object in `KHR_implicit_shapes`. The `shape.type` should be set to `"cylinder region"`. The properties define a region following the surface of a cylinder between two different radius values. @@ -32,7 +32,9 @@ The cylinder is centered at the origin, where the radius is measured along the ` </th> </tr> <tr> - <td><pre> + <td> + +```json "extensions": [ { "KHR_implicit_shapes": { @@ -51,14 +53,20 @@ The cylinder is centered at the origin, where the radius is measured along the ` } } ] - </pre></td> +``` + + </td> <td> - **TODO** visual example + <img src="figures/hollow-cylinder.png"> </td> </tr> </table> -A cylinder region may also be confined to a certain angular range. The `minAngle` and `maxAngle` properties define the angles at which the region starts and stops on the cylinder. These angular bounds are given in radians within the range `[-pi, pi]`. +A cylinder region may also be confined to a certain angular range. The `minAngle` and `maxAngle` properties define the angles at which the region starts and stops on the cylinder. + +Angles are given in radians within the range `[-pi, pi]` and open clockwise around the cylinder (see figure below). + + <table> <tr> @@ -67,7 +75,9 @@ A cylinder region may also be confined to a certain angular range. The `minAngle </th> </tr> <tr> - <td><pre> + <td> + +```json "extensions": [ { "KHR_implicit_shapes": { @@ -80,7 +90,7 @@ A cylinder region may also be confined to a certain angular range. The `minAngle "maxRadius": 1, "height": 2, "minAngle": 0 - "maxAngle": 1.57079632679 + "maxAngle": 3.1415 } } } @@ -88,9 +98,10 @@ A cylinder region may also be confined to a certain angular range. The `minAngle } } ] - </pre></td> +``` +</td> <td> - **TODO** visual example + <img src="figures/half-cylinder.png"> </td> </tr> </table> diff --git a/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/cylinder-angle.png b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/cylinder-angle.png new file mode 100644 index 0000000000..839db634dd Binary files /dev/null and b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/cylinder-angle.png differ diff --git a/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/half-cylinder.png b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/half-cylinder.png new file mode 100644 index 0000000000..3d2b728701 Binary files /dev/null and b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/half-cylinder.png differ diff --git a/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/hollow-cylinder.png b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/hollow-cylinder.png new file mode 100644 index 0000000000..b47ee174ee Binary files /dev/null and b/extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/hollow-cylinder.png differ diff --git a/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/README.md b/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/README.md index ea9b422537..38dc3c9e21 100644 --- a/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/README.md +++ b/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/README.md @@ -8,11 +8,11 @@ Draft ## Dependencies -Written against the glTF 2.0 specification. +Written against the glTF 2.0 specification. Depends on the [`KHR_implicit_shapes`](https://github.com/eoineoineoin/glTF/tree/refs/heads/collisionShapeMerge/extensions/2.0/Khronos/KHR_implicit_shapes) extension. ## Overview -This extension defines an ellipsoid-conforming region as an additional shape type for the [`KHR_implicit_shapes`](https://github.com/eoineoineoin/glTF/tree/refs/heads/collisionShapeMerge/extensions/2.0/Khronos/KHR_implicit_shapes) extension. These regions are commonly used in geospatial applications to describe volumes that conform to the curvature of the Earth, or other bodies. +This extension defines an ellipsoid-conforming region as an additional shape type for the `KHR_implicit_shapes` extension. These regions are commonly used in geospatial applications to describe volumes that conform to the curvature of the Earth, or other bodies. `EXT_implicit_ellipsoid_region` extends the `shape` object in `KHR_implicit_shapes`. The `shape.type` should be set to `"ellipsoid region"`. The properties define the region following the surface of the ellipsoid between two different height values. @@ -20,20 +20,15 @@ The volume does not necessarily contain the full ellipsoid—and for many geospa ### Details -The reference ellipsoid is centered at the origin. The `semiMajorAxisRadius` indicates the radius of the ellipsoid in meters along the `x` and `z` axes. The radii for these axes are made equal in a conscious decision to simplify the math required to render implicit regions. +The reference ellipsoid is centered at the origin. The `semiMajorAxisRadius` indicates the radius of the ellipsoid in meters along the `x` and `z` axes. The `semiMinorAxisRadius` indicates the radius of the ellipsoid in meters along the `y` axis. -The `semiMinorAxisRadius` indicates the radius of the ellipsoid in meters along the `y` axis. +> The `x` and `z` radii are made equal to simplify the math required to render implicit regions along the ellipsoid. -The `minHeight` and `maxHeight` properties indicate the heights of the region from the ellipsoid's surface in meters. The `minHeight` should be a lower value, though not necessarily lower in magnitude. For example, `maxHeight` may be `10` meters while `minHeight` is `-100`. +The `minHeight` and `maxHeight` properties indicate the heights of the region from the ellipsoid's surface in meters. A height of `0` sits right at the surface. Negative heights are also valid—they simply extend underneath the ellipsoid's surface. -<table> - <tr> - <th> - Example - </th> - </tr> - <tr> - <td><pre> +This example corresponds to the image below it: + +```json "extensions": [ { "KHR_implicit_shapes": { @@ -42,7 +37,7 @@ The `minHeight` and `maxHeight` properties indicate the heights of the region fr "type": "ellipsoid region", "extensions": { "EXT_implicit_ellipsoid_region": { - "semiMajorAxisRadius": 4, + "semiMajorAxisRadius": 3.5, "semiMinorAxisRadius": 2, "minHeight": 0, "maxHeight": 0.5 @@ -53,23 +48,13 @@ The `minHeight` and `maxHeight` properties indicate the heights of the region fr } } ] - </pre></td> - <td> - **TODO** visual example - </td> - </tr> -</table> +``` + + An ellipsoid region may also be confined to a specific latitude and/or longitude range. The `minLatitude` and `maxLatitude` properties represent the latitude values at which the region starts and stops, defined in the range `[-pi/2, pi/2]`. Similarly, the `minLongitude` and `maxLongitude` properties represent the longitude bounds within the range `[-pi, pi]`. -<table> - <tr> - <th> - Example - </th> - </tr> - <tr> - <td><pre> +```json "extensions": [ { "KHR_implicit_shapes": { @@ -78,13 +63,13 @@ An ellipsoid region may also be confined to a specific latitude and/or longitude "type": "ellipsoid region", "extensions": { "EXT_implicit_ellipsoid_region": { - "semiMajorAxisRadius": 4, + "semiMajorAxisRadius": 3.5, "semiMinorAxisRadius": 2, "minHeight": 0, "maxHeight": 0.5, - "minLongitude": -1.57079632679, + "minLongitude": 0, "maxLongitude": 1.57079632679, - "minLatitude": 0, + "minLatitude": -0.78539816339, "maxLatitude": 0.78539816339, } } @@ -93,12 +78,9 @@ An ellipsoid region may also be confined to a specific latitude and/or longitude } } ] - </pre></td> - <td> - **TODO** visual example - </td> - </tr> -</table> +``` + + It is valid for the `maxLongitude` property to be less than `minLongitude`. This would define a region that crosses over the line at `-pi` or `pi`, equivalent to the International Date Line on Earth. diff --git a/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/half-ellipsoid.png b/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/half-ellipsoid.png new file mode 100644 index 0000000000..11f97c60be Binary files /dev/null and b/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/half-ellipsoid.png differ diff --git a/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/hollow-ellipsoid.png b/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/hollow-ellipsoid.png new file mode 100644 index 0000000000..84abb5d206 Binary files /dev/null and b/extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/hollow-ellipsoid.png differ diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/README.md b/extensions/2.0/Vendor/EXT_primitive_voxels/README.md index 43962b2e07..9ee3352e3e 100644 --- a/extensions/2.0/Vendor/EXT_primitive_voxels/README.md +++ b/extensions/2.0/Vendor/EXT_primitive_voxels/README.md @@ -5,6 +5,7 @@ </p> ## Contributors + - Daniel Krupka, Cesium - Ian Lilley, Cesium - Sean Lilley, Cesium @@ -12,45 +13,61 @@ - Jeshurun Hembd, Cesium ## Status + Draft ## Dependencies -Written against the glTF 2.0 specification. + +Written against the glTF 2.0 specification. Depends on the [`KHR_implicit_shapes`](https://github.com/eoineoineoin/glTF/tree/refs/heads/collisionShapeMerge/extensions/2.0/Khronos/KHR_implicit_shapes) extension. ## Overview -This extension allows mesh primitives to represent volumetric (voxel) data via custom attributes. Primitives that use this extension must set their `mode` to the constant `0x7FFFFFFF` (`2147483647`), which is used to indicate voxels. +This extension allows mesh primitives to represent volumetric (voxel) data via custom attributes. Primitives that use this extension must set their `mode` to the constant `0x7FFFFFFF` (`2147483647`) used to indicate voxels. -Typically, glTF mesh primitives use the `POSITION` attribute to store positional mesh data. However, `POSITION` is neither required nor used by this extension. Instead, `EXT_primitive_voxels` relies on the [`KHR_implicit_shapes` extension](TODO) to describe the shape of the voxel grid. +Typical mesh primitives make use of the `POSITION` attribute to store positional mesh data. However, `POSITION` is neither required nor used by `EXT_primitive_voxels` Instead, this extension relies on the `KHR_implicit_shapes` extension to describe the shape of the voxel grid. -``` -"primitives": [ - { - "attributes": { - "_TEMPERATURE": 0 - }, - "mode": 2147483648, - "extensions": { - "EXT_primitive_voxels": { - "shape": 0, - "dimensions": [8, 8, 8], - "padding": { - "before": [1, 1, 1], - "after": [1, 1, 1] +```json +{ + "extensions": { + "KHR_implicit_shapes": { + "shapes": [ + { + "type": "box", + "box": { + "size": [2, 2, 2] } - } + } + ] } - } -] + }, + "meshes": [ + { + "primitives": [ + { + "attributes": { + "_TEMPERATURE": 0 + }, + "mode": 2147483648, + "extensions": { + "EXT_primitive_voxels": { + "shape": 0, + "dimensions": [8, 8, 8] + } + } + } + ] + } + ] +} ``` -Although voxels are commonly associated with cubic geometry on a box-based grid, this extension allows voxels to be based on other types of grid geometry from `KHR_implicit_shapes`. This includes cylinder-based regions specified by [`EXT_implicit_cylinder_region`](../EXT_implicit_cylinder_region/, as well as ellipsoid-based regions specified by [`EXT_implicit_ellipsoid_region`](../EXT_implicit_ellipsoid_region/), visualized below. +Though voxels are commonly associated with cubic geometry on a box-based grid, this extension allows voxels to be based on other types of grid geometry. This currently includes cylinder-based regions specified by [`EXT_implicit_cylinder_region`](../EXT_implicit_cylinder_region/) as well as ellipsoid-based regions specified by [`EXT_implicit_ellipsoid_region`](../EXT_implicit_ellipsoid_region/). The supported shapes are visualized below. |Box|Cylinder|Region| | ------------- | ------------- | ------------- | |||| -Within this geometry, voxels exist inside a bounding volume that conforms to the geometry of the grid. The `dimensions` property refers to the number of subdivisions _within_ this bounding volume. Each value of `dimensions` must be a positive integer. +Voxels exist inside a bounding volume that conforms to the shape of the grid. The `dimensions` property refers to the number of subdivisions _within_ this bounding volume. Each value of `dimensions` must be a positive integer. The relationship between `dimensions` and the grid geometry is explained in detail below. @@ -66,86 +83,77 @@ These properties may be used to define the scale of the box grid, independent of  <p align="center"><i>A box grid that is non-uniformly scaled due to its min and max properties. It is also non-uniformly subdivided.</i></p> -### Cylinder Grid +Elements are laid out in memory where the `x` data is contiguous (up to stride). -A **cylinder** grid is subdivided along the radius, height, and angle ranges of the cylinder, visualized below. +### Cylinder Region Grid - - -The cylinder is aligned with the `y`-axis in the primitive's local space. As such, the `height` is subdivided along that local `y`-axis. Subdivisions along the `radius` are concentric, centered around the `y`-axis and extending outwards. The `angle` is subdivided around the circumference of the cylinder. +A **cylinder** region grid is subdivided along the radius, height, and angle ranges of the region, visualized below. -[TODO](image) + -### Ellipsoid-based Region Grid +The cylinder is aligned with the `y`-axis in the primitive's local space. As such, the `height` is subdivided along that local `y`-axis. Subdivisions along the radius are concentric, centered around the `y`-axis and extending outwards. The angle is subdivided around the circumference of the cylinder. -For **EXT_implicit_ellipsoid_region** geometry, TODO. +Elements are laid out in memory where the radius data is contiguous (up to stride). -The `bounds` refer to the section of the ellipsoid that the voxel data occupies. `(-pi, -pi/2, 0)` and `(pi, pi/2, 1)` +### Ellipsoid Region Grid - Elements are laid out in memory on a first-axis-contiguous basis. For instance, with box-shaped voxels, the `x` data is contiguous (up to stride). +An **ellipsoid** region grid is subdivided along the longitude, latitude, and height ranges of the region, visualized below. -contains minimum and maximum values along the axes and/or parameters that control the grid's shape. These ranges are interpreted relative to the geometry of the grid, as indicated by the primitive's `mode`. +Elements are laid out in memory where the `longitude` data is contiguous (up to stride). ### Padding -``` - "padding": { - "before": [1, 1, 1], - "after": [1, 1, 1] +```json +"extensions": { + "EXT_primitive_voxels": { + "shape": 0, + "dimensions": [8, 8, 8], + "padding": { + "before": [1, 1, 1], + "after": [1, 1, 1] + } } +} ``` The `padding` property specifies how many rows of attribute data in each dimension come from neighboring grids. This is useful in situations where the primitive represents a single tile in a larger grid, and data from neighboring tiles is needed for non-local effects e.g. trilinear interpolation, blurring, antialiasing. `padding.before` and `padding.after` specify the number of rows before and after the grid in each dimension, e.g. a `padding.before` of 1 and a `padding.after` of 2 in the `y` dimension mean that each series of values in a given `y`-slice is preceded by one value and followed by two. The padding data must be supplied with the rest of the voxel data - this means if `dimensions` is `[d1, d2, d3]`, `padding.before` is `[b1, b2, b3]`, and `padding.after` is `[a1, a2, a3]`, the attribute must supply `(d1 + a1 + b1)*(d2 + a2 + b2)*(d3 + a3 + b3)` elements. -### Full Example +### No Data Values -``` -{ - "extensions": { - "KHR_implicit_shapes": { - "shapes": [ - { - "box": { - "size": [2, 2, 2] - } - } - ] - }, - "meshes": [ - { - "primitives": [ - { - "attributes": { - "_TEMPERATURE": 0 - }, - "mode": 2147483648, - "extensions": { - "EXT_primitive_voxels": { +```json +"meshes": [ + { + "primitives": [ + { + "attributes": { + "_TEMPERATURE": 0, + "_SALINITY": 1, + "_DATA_LOSS": 2 + }, + "mode": 2147483648, + "extensions": { + "EXT_primitive_voxels": { "shape": 0, "dimensions": [8, 8, 8], - "bounds": { - "min": [0.25, 0.5, 0.5], - "max": [0.375, 0.625, 0.625] - }, - "padding": { - "before": [1, 1, 1], - "after": [1, 1, 1] + "noData": { + "_TEMPERATURE": -999.99, + "_SALINITY": -999 } - } } } - ] - } - ] -} + } + ] + } +] ``` + ### Metadata This extension may be paired with the `EXT_structural_metadata` extension to convey more semantic information about the voxel attributes. -``` +```json { "extensions": { "KHR_implicit_shapes": { diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/figures/non-uniform-box.png b/extensions/2.0/Vendor/EXT_primitive_voxels/figures/non-uniform-box.png index 281bd05598..2cf8a6e153 100644 Binary files a/extensions/2.0/Vendor/EXT_primitive_voxels/figures/non-uniform-box.png and b/extensions/2.0/Vendor/EXT_primitive_voxels/figures/non-uniform-box.png differ diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/figures/uniform-box.png b/extensions/2.0/Vendor/EXT_primitive_voxels/figures/uniform-box.png index 8a31fef566..241c86bd34 100644 Binary files a/extensions/2.0/Vendor/EXT_primitive_voxels/figures/uniform-box.png and b/extensions/2.0/Vendor/EXT_primitive_voxels/figures/uniform-box.png differ diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/schema/definitions.schema.json b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/definitions.schema.json new file mode 100644 index 0000000000..8a5c9cb76e --- /dev/null +++ b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/definitions.schema.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "definitions.schema.json", + "title": "Definitions", + "description": "Common definitions used in schema files.", + "definitions": { + "noDataValue": { + "title": "No Data Value", + "oneOf": [ + { + "type": "number" + }, + { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 1 + }, + "minItems": 1 + } + ], + "description": "For `SCALAR` attributes this is a number. For `VECN` attributes this is an array of `N` numbers. For `MATN` attributes this is `N` arrays of `N` numbers." + } + } +} \ No newline at end of file diff --git a/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json index 9dabcb9658..2af3ad17f7 100644 --- a/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json +++ b/extensions/2.0/Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json @@ -31,6 +31,18 @@ "padding": { "description": "The optional padding of the voxels.", "$ref": "padding.schema.json" + }, + "noData": { + "description": "A plain JSON object, where each key corresponds to a mesh attribute semantic and each value is the attribute's `noData` value. A `noData` value represents missing data — also known as a sentinel value — wherever it appears.", + "type": "object", + "minProperties": 1, + "additionalProperties": { + "allOf": [ + { + "$ref": "definitions.schema.json#/definitions/noDataValue" + } + ] + } } }, "required": [