Skip to content

Commit

Permalink
Add to EXT_primitive_voxels, update figures
Browse files Browse the repository at this point in the history
  • Loading branch information
j9liu committed Jan 30, 2025
1 parent af8ea2d commit 92688a3
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 120 deletions.
31 changes: 21 additions & 10 deletions extensions/2.0/Vendor/EXT_implicit_cylinder_region/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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": {
Expand All @@ -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).

![](figures/cylinder-angle.png)

<table>
<tr>
Expand All @@ -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": {
Expand All @@ -80,17 +90,18 @@ 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
}
}
}
]
}
}
]
</pre></td>
```
</td>
<td>
**TODO** visual example
<img src="figures/half-cylinder.png">
</td>
</tr>
</table>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 19 additions & 37 deletions extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,27 @@
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.

The volume does not necessarily contain the full ellipsoid—and for many geospatial use cases, it will not. Rather, the ellipsoid is used as a reference from which the actual region is extruded. However, a region may be extend beneath the surface of the ellipsoid. Given the right height values, the region could contain the entire ellipsoid if desired.

### 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": {
Expand All @@ -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
Expand All @@ -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>
```

![](figures/hollow-ellipsoid.png)

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": {
Expand All @@ -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,
}
}
Expand All @@ -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>
```

![](figures/half-ellipsoid.png)

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.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 92688a3

Please sign in to comment.