forked from KhronosGroup/glTF
-
Notifications
You must be signed in to change notification settings - Fork 9
Revise EXT_primitive_voxels
#69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lilleyse
merged 26 commits into
ext-primitive-voxels
from
ext-primitive-voxels-revisions
Jan 31, 2025
Merged
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
dcc826e
Update README.md
j9liu 0107640
Add box grid visuals
j9liu b3a961d
Add cylinder grid visuals
j9liu 40ebbdb
Begin rewriting bounds property
j9liu c805aaf
Add voxel grid geometry schemas
j9liu dc1029a
Add EXT_implicit_geometry
j9liu 22e2c71
Bounds -> Slice
j9liu 98f2868
Begin to tie EXT_implicit_geometry into EXT_primitive_voxels
j9liu be26d0f
Move EXT_implicit_geometry to glTF root
j9liu 74113f2
Fix broken uris
j9liu c9c6abf
Fix typos in region slice
j9liu 60a4b4f
Add 'shape' to voxel extension
j9liu cd6749e
Make shape integer + required
j9liu 981c69b
Use glTFid instead
j9liu 9e8df19
Delete extraneous characters
j9liu 1244f79
Remove EXT_implicit_geometry, add EXT_implicit_ellipsoid_region
j9liu 2b387c0
Add cylinder region extension
j9liu 6dec236
Minor cleanup
j9liu fe44738
Fix some typos and outdated info
j9liu ea998cf
Tweak `EXT_implicit_cylinder_region` README
j9liu 5048335
Update README.md for EXT_implicit_ellipsoid_region
j9liu cfe3cc7
Try updating CI to v4
j9liu af8ea2d
Change v2 -> v4
j9liu 92688a3
Add to EXT_primitive_voxels, update figures
j9liu 351ef49
Finalize EXT_primitive_voxels README
j9liu 519ff87
Review feedback
j9liu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
extensions/2.0/Vendor/EXT_implicit_cylinder_region/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| # EXT_implicit_cylinder_region | ||
|
|
||
| ## Contributors | ||
|
|
||
| - Sean Lilley, Cesium | ||
| - Janine Liu, Cesium | ||
|
|
||
| ## Status | ||
|
|
||
| Draft | ||
|
|
||
| ## Dependencies | ||
|
|
||
| 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` 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. | ||
|
|
||
| The cylinder does not need to be completely represented by the volume—for instance, the region may be hollow inside like a tube. However, an inner radius of `0` results in a completely solid cylinder. | ||
|
|
||
| ### Details | ||
|
|
||
| The cylinder is centered at the origin, where the radius is measured along the `x` and `z` axes. The `height` of the cylinder is aligned with the `y` axis. | ||
|
|
||
| <table> | ||
| <tr> | ||
| <th> | ||
| Example | ||
| </th> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
|
|
||
| ```json | ||
| "extensions": [ | ||
| { | ||
| "KHR_implicit_shapes": { | ||
| "shapes": [ | ||
| { | ||
| "type": "cylinder region", | ||
| "extensions": { | ||
| "EXT_implicit_cylinder_region": { | ||
| "minRadius": 0.5, | ||
| "maxRadius": 1, | ||
| "height": 2 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| </td> | ||
| <td> | ||
| <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. | ||
|
|
||
| Angles are given in radians within the range `[-pi, pi]` and open clockwise around the cylinder (see figure below). | ||
|
|
||
|  | ||
|
|
||
| <table> | ||
| <tr> | ||
| <th> | ||
| Example | ||
| </th> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
|
|
||
| ```json | ||
| "extensions": [ | ||
| { | ||
| "KHR_implicit_shapes": { | ||
| "shapes": [ | ||
| { | ||
| "type": "cylinder region", | ||
| "extensions": { | ||
| "EXT_implicit_cylinder_region": { | ||
| "minRadius": 0.5, | ||
| "maxRadius": 1, | ||
| "height": 2, | ||
| "minAngle": 0, | ||
| "maxAngle": 3.1415 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| ``` | ||
| </td> | ||
| <td> | ||
| <img src="figures/half-cylinder.png"> | ||
| </td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| ## Optional vs. Required | ||
| This extension is required, meaning it should be placed in both the `extensionsUsed` list and `extensionsRequired` list. | ||
Binary file added
BIN
+29.7 KB
extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/cylinder-angle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.27 KB
extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/half-cylinder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
extensions/2.0/Vendor/EXT_implicit_cylinder_region/figures/hollow-cylinder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions
48
...der_region/schema/glTF.KHR_implicit_shapes.shape.EXT_implicit_cylinder_region.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "glTF.KHR_implicit_shapes.shape.EXT_implicit_cylinder_region.schema.json", | ||
| "title": "EXT_implicit_cylinder_region extension on KHR_implicit_shapes.shape", | ||
| "type": "object", | ||
| "description": "Extension of `KHR_implicit_shapes.shape` to represent an implicit cylinder region in a glTF model.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "glTFProperty.schema.json" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "minRadius": { | ||
| "type": "number", | ||
| "description": "The inner radius of the cylinder region along the X and Z axes, in meters.", | ||
| "minimum": 0 | ||
| }, | ||
| "maxRadius": { | ||
| "type": "number", | ||
| "description": "The outer radius of the cylinder region along the X and Z axes, in meters.", | ||
| "minimum": 0 | ||
| }, | ||
| "height": { | ||
| "type": "number", | ||
| "description": "The height of the cylinder in meters along the Y-axis, in meters.", | ||
| "minimum": 0 | ||
| }, | ||
| "minAngle": { | ||
| "type": "number", | ||
| "description": "The minimum angle of the cylinder region in radians. In other words, this is the angle where the cylinder region starts. Must be in the range [-pi, pi].", | ||
| "minimum": -3.14159265359, | ||
| "maximum": 3.14159265359, | ||
| "default": -3.14159265359 | ||
| }, | ||
| "maxAngle": { | ||
| "type": "number", | ||
| "description": "The maximum angle of the cylinder region in radians. In other words, this is the angle where the cylinder region ends. Must be in the range [-pi, pi].", | ||
| "minimum": -3.14159265359, | ||
| "maximum": 3.14159265359, | ||
| "default": 3.14159265359 | ||
| } | ||
| }, | ||
| "required": [ | ||
| "minRadius", | ||
| "maxRadius", | ||
| "height" | ||
| ] | ||
| } |
88 changes: 88 additions & 0 deletions
88
extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # EXT_implicit_ellipsoid_region | ||
|
|
||
| ## Contributors | ||
| - Sean Lilley, Cesium | ||
| - Janine Liu, Cesium | ||
|
|
||
| ## Status | ||
| Draft | ||
|
|
||
| ## Dependencies | ||
| 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` 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 `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. A height of `0` sits right at the surface. Negative heights are also valid—they simply extend underneath the ellipsoid's surface. | ||
|
|
||
| This example corresponds to the image below it: | ||
|
|
||
| ```json | ||
| "extensions": [ | ||
| { | ||
| "KHR_implicit_shapes": { | ||
| "shapes": [ | ||
| { | ||
| "type": "ellipsoid region", | ||
| "extensions": { | ||
| "EXT_implicit_ellipsoid_region": { | ||
| "semiMajorAxisRadius": 3.5, | ||
| "semiMinorAxisRadius": 2, | ||
| "minHeight": 0, | ||
| "maxHeight": 0.5 | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| 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]`. | ||
|
|
||
| ```json | ||
| "extensions": [ | ||
| { | ||
| "KHR_implicit_shapes": { | ||
| "shapes": [ | ||
| { | ||
| "type": "ellipsoid region", | ||
| "extensions": { | ||
| "EXT_implicit_ellipsoid_region": { | ||
| "semiMajorAxisRadius": 3.5, | ||
| "semiMinorAxisRadius": 2, | ||
| "minHeight": 0, | ||
| "maxHeight": 0.5, | ||
| "minLongitude": 0, | ||
| "maxLongitude": 1.57079632679, | ||
| "minLatitude": -0.78539816339, | ||
| "maxLatitude": 0.78539816339, | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| 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. | ||
|
|
||
| ## Optional vs. Required | ||
| This extension is required, meaning it should be placed in both the `extensionsUsed` list and `extensionsRequired` list. |
Binary file added
BIN
+29.9 KB
extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/half-ellipsoid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.1 KB
extensions/2.0/Vendor/EXT_implicit_ellipsoid_region/figures/hollow-ellipsoid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions
66
...id_region/schema/glTF.KHR_implicit_shapes.shape.EXT_implicit_ellipsoid_region.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "glTF.KHR_implicit_shapes.shape.EXT_implicit_ellipsoid_region.schema.json", | ||
| "title": "EXT_implicit_ellipsoid_region extension on KHR_implicit_shapes.shape", | ||
| "type": "object", | ||
| "description": "Extension of `KHR_implicit_shapes.shape` to represent an implicit ellipsoid region in a glTF model.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "glTFProperty.schema.json" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "semiMajorAxisRadius": { | ||
| "type": "number", | ||
| "description": "The radius along the semi-major axis of the reference ellipsoid in meters. Corresponds to the radii along the X and Z axes.", | ||
| "minimum": 0 | ||
| }, | ||
| "semiMinorAxisRadius": { | ||
| "type": "number", | ||
| "description": "The radius along the semi-minor axis of the reference ellipsoid in meters. Corresponds to the radius along the Y-axis.", | ||
| "minimum": 0 | ||
| }, | ||
| "minHeight": { | ||
| "type": "number", | ||
| "description": "The minimum height of the region relative to the ellipsoid's surface, in meters. May be negative." | ||
| }, | ||
| "maxHeight": { | ||
| "type": "number", | ||
| "description": "The maximum height of the region relative to the ellipsoid's surface, in meters. May be negative." | ||
| }, | ||
| "minLatitude": { | ||
| "type": "number", | ||
| "description": "The minimum latitude (a.k.a. polar angle) of the region, in radians. Must be in the range [-pi/2, pi/2].", | ||
| "minimum": -1.57079632679, | ||
| "maximum": 1.57079632679, | ||
| "default": -1.57079632679 | ||
| }, | ||
| "maxLatitude": { | ||
| "type": "number", | ||
| "description": "The maximum latitude (a.k.a. polar angle) of the region, in radians. Must be in the range [-pi/2, pi/2].", | ||
| "minimum": -1.57079632679, | ||
| "maximum": 1.57079632679, | ||
| "default": 1.57079632679 | ||
| }, | ||
| "minLongitude": { | ||
| "type": "number", | ||
| "description": "The minimum longitude (a.k.a. azimuthal angle) of the region, in radians. Must be in the range [-pi, pi].", | ||
| "minimum": -3.14159265359, | ||
| "maximum": 3.14159265359, | ||
| "default": -3.14159265359 | ||
| }, | ||
| "maxLongitude": { | ||
| "type": "number", | ||
| "description": "The maximum longitude (a.k.a. azimuthal angle) of the region, in radians. Must be in the range [-pi, pi].", | ||
| "minimum": -3.14159265359, | ||
| "maximum": 3.14159265359, | ||
| "default": 3.14159265359 | ||
| } | ||
| }, | ||
| "required": [ | ||
| "semiMajorAxisRadius", | ||
| "semiMinorAxisRadius", | ||
| "minHeight", | ||
| "maxHeight" | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.