forked from KhronosGroup/glTF
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
677 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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,141 @@ | ||
# EXT_implicit_geometry | ||
|
||
## Contributors | ||
- Sean Lilley, Cesium | ||
- Janine Liu, Cesium | ||
|
||
## Status | ||
Draft | ||
|
||
## Dependencies | ||
Written against the glTF 2.0 specification. | ||
|
||
## Overview | ||
|
||
This extension allows mesh primitives to represent renderable implicit surfaces. Typically, a glTF mesh primitive requires `attributes` that supply mesh data, and uses `mode` to indicate the mesh topology. With `EXT_implicit_geometry`, the primitive may omit these properties. The extension's properties will be used instead to infer the implicit 3D volume. | ||
|
||
The following example illustrates how a primitive with this extension may represent an implicit box. | ||
|
||
``` | ||
{ | ||
"primitives": [ | ||
{ | ||
"extensions": { | ||
"EXT_implicit_geometry": { | ||
"box": { | ||
"size": [2, 2, 2] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
Primitives with this extension may still be affected by node transforms to position, orient, and scale the shape as needed. | ||
|
||
## Supported Geometry | ||
|
||
Currently, this extension supports the following implicit geometries: | ||
- [`box`](#box) | ||
- [`cylinder`](#cylinder) | ||
- [`sphere`](#sphere) | ||
- [`ellipsoid`](#ellipsoid) | ||
- [`region`](#region) | ||
|
||
Each shape is represented by its aptly named property in the extension. Only **one** shape may be defined at a time. | ||
|
||
By default, the implicit 3D volume is assumed to fill the entire shape specified in the extension. However, each shape allows an optional `bounds` property to define the subsection of the shape in which the 3D volume is actually rendered. For instance, while the extension may define an implicit sphere, its `bounds` can limit the volume to be only half of the full sphere. | ||
|
||
### Box | ||
|
||
The implicit **box** is axis-aligned and centered at the origin, spanning from `(-1, -1, -1)` to `(1, 1, 1)` in local space. | ||
|
||
![](figures/unit-box.png) | ||
|
||
The `size` property specifies the scale of the box in meters along the `x`, `y`, and `z` axes. This may be specified non-uniformly, as shown below. | ||
|
||
![](figures/non-uniform-box.png) | ||
|
||
The `bounds` indicate which fraction of the box is actually rendered along each axis. The range of the box is mapped between 0 and 1, where the minimum corner is represented by 0, and the maximum corner is represented by 1. Thus, the bounds on the volume are defined within this range. | ||
|
||
![](figures/unit-box-with-bounds.png) | ||
|
||
Like `size`, the `bounds` may also be non-uniform. | ||
|
||
![](figures/non-uniform-box-with-bounds.png) | ||
|
||
|
||
#### Full Example | ||
|
||
``` | ||
{ | ||
"primitives": [ | ||
{ | ||
"extensions": { | ||
"EXT_implicit_geometry": { | ||
"box": { | ||
"size": [2, 2, 2], | ||
"bounds": { | ||
"min": [0.25, 0, 0.25] | ||
"max": [0.75, 0.5, 1] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Cylinder | ||
|
||
The implicit **cylinder** is aligned with the `y`-axis and centered at the origin in local space. The unit cylinder has a radius of 1 and spans from `[-1, 1]` along the y-axis. The `radius` and `height` properties specify the scale of the cylinder in these respective parameters, in meters. | ||
|
||
**TODO** visual example | ||
|
||
``` | ||
{ | ||
"primitives": [ | ||
{ | ||
"extensions": { | ||
"EXT_implicit_geometry": { | ||
"cylinder": { | ||
"radius": 2, | ||
"height": 2.5 | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Sphere | ||
|
||
The implicit **sphere** is centered at the origin in local space. The unit sphere has a radius of 1. A `radius` is specified to scale the sphere in meters. | ||
|
||
**TODO** visual example | ||
|
||
``` | ||
{ | ||
"primitives": [ | ||
{ | ||
"extensions": { | ||
"EXT_implicit_geometry": { | ||
"sphere": { | ||
"radius": 2 | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Ellipsoid | ||
|
||
The implicit **ellipsoid** is centered at the origin in local space. The unit ellipsoid has radii of `[1, 1, 1]` along the `x`, `y`, and `z` axes. The `radii` property is used to scale the ellipsoid along these axes in meters. | ||
|
||
## Optional vs. Required | ||
This extension is required, meaning it should be placed in both the `extensionsUsed` list and `extensionsRequired` list. |
Binary file added
BIN
+49.5 KB
...nsions/2.0/Vendor/EXT_implicit_geometry/figures/non-uniform-box-with-bounds.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
+41.1 KB
extensions/2.0/Vendor/EXT_implicit_geometry/figures/non-uniform-box.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
+53.3 KB
extensions/2.0/Vendor/EXT_implicit_geometry/figures/unit-box-with-bounds.png
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.
38 changes: 38 additions & 0 deletions
38
extensions/2.0/Vendor/EXT_implicit_geometry/schema/box.bounds.schema.json
This file contains 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,38 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "box.bounds.schema.json", | ||
"title": "Box Bounds", | ||
"type": "object", | ||
"description": "A set of bounds for an implicit box surface. Defines the fraction of the box that the implicit volume actually occupies.", | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFProperty.schema.json" | ||
} | ||
], | ||
"properties": { | ||
"min": { | ||
"type": "array", | ||
"description": "The minimum bounds of the box in three dimensions.", | ||
"items": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1, | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3, | ||
"default": [0, 0, 0] | ||
}, | ||
"max": { | ||
"type": "array", | ||
"description": "The maximum bounds of the box in three dimensions.", | ||
"items": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1, | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3, | ||
"default": [1, 1, 1] | ||
}, | ||
}, | ||
} |
30 changes: 30 additions & 0 deletions
30
extensions/2.0/Vendor/EXT_implicit_geometry/schema/box.schema.json
This file contains 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,30 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "box.schema.json", | ||
"title": "Box", | ||
"type": "object", | ||
"description": "An implicit box centered at the local space origin.", | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFProperty.schema.json" | ||
} | ||
], | ||
"properties": { | ||
"size": { | ||
"type": "array", | ||
"description": "The size of the box in three dimensions.", | ||
"items": { | ||
"type": "number" | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3 | ||
}, | ||
"bounds": { | ||
"$ref": "box.bounds.schema.json", | ||
"description": "The optional bounds of the box." | ||
} | ||
}, | ||
"required": [ | ||
"size" | ||
] | ||
} |
56 changes: 56 additions & 0 deletions
56
extensions/2.0/Vendor/EXT_implicit_geometry/schema/cylinder.bounds.schema.json
This file contains 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,56 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "cylinder.bounds.schema.json", | ||
"title": "Cylinder Bounds", | ||
"type": "object", | ||
"description": "A set of bounds for an implicit cylinder surface. Defines the subsection of the cylinder that the implicit volume actually occupies.", | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFProperty.schema.json" | ||
} | ||
], | ||
"properties": { | ||
"minRadius": { | ||
"type": "number", | ||
"description": "The minimum radial bound of the cylinder.", | ||
"minimum": 0, | ||
"maximum": 1, | ||
"default": 0 | ||
}, | ||
"maxRadius": { | ||
"type": "number", | ||
"description": "The maximum radial bound of the cylinder.", | ||
"minimum": 0, | ||
"maximum": 1, | ||
"default": 1 | ||
}, | ||
"minHeight": { | ||
"type": "number", | ||
"description": "The minimum height bound of the cylinder.", | ||
"minimum": 0, | ||
"maximum": 1, | ||
"default": 0 | ||
}, | ||
"maxHeight": { | ||
"type": "number", | ||
"description": "The maximum height bound of the cylinder.", | ||
"minimum": 0, | ||
"maximum": 1, | ||
"default": 1 | ||
}, | ||
"minAngle": { | ||
"type": "number", | ||
"description": "The maximum angular bound of the cylinder in radians. Values must be in the range [-pi, pi].", | ||
"minimum": -3.14159265359, | ||
"maximum": 3.14159265359, | ||
"default": -3.14159265359 | ||
}, | ||
"maxAngle": { | ||
"type": "number", | ||
"description": "The maximum angular bound of the cylinder in radians. Values must be in the range [-pi, pi].", | ||
"minimum": -3.14159265359, | ||
"maximum": 3.14159265359, | ||
"default": 3.14159265359 | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
extensions/2.0/Vendor/EXT_implicit_geometry/schema/cylinder.schema.json
This file contains 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,32 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "cylinder.schema.json", | ||
"title": "Cylinder", | ||
"type": "object", | ||
"description": "An implicit cylinder centered at the local space origin.", | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFProperty.schema.json" | ||
} | ||
], | ||
"properties": { | ||
"radius": { | ||
"type": "number", | ||
"description": "The radius of the cylinder in local space.", | ||
"minimum": 0 | ||
}, | ||
"height": { | ||
"type": "number", | ||
"description": "The height of the cylinder in local space.", | ||
"minimum": 0 | ||
}, | ||
"bounds": { | ||
"$ref": "cylinder.bounds.schema.json", | ||
"description": "The optional bounds of the cylinder." | ||
} | ||
}, | ||
"required": [ | ||
"radius", | ||
"height" | ||
] | ||
} |
52 changes: 52 additions & 0 deletions
52
extensions/2.0/Vendor/EXT_implicit_geometry/schema/ellipsoid.bounds.schema.json
This file contains 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,52 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "ellipsoid.bounds.schema.json", | ||
"title": "Ellipsoid Bounds", | ||
"type": "object", | ||
"description": "A set of bounds for an implicit ellipsoid surface. Defines the subsection of the ellipsoid that the implicit volume actually occupies.", | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFProperty.schema.json" | ||
} | ||
], | ||
"properties": { | ||
"minRadius": { | ||
"type": "number", | ||
"description": "The minimum radial bound of the ellipsoid.", | ||
"minimum": 0, | ||
"maximum": 1, | ||
"default": 0 | ||
}, | ||
"maxRadius": { | ||
"type": "number", | ||
"description": "The maximum radial bound of the ellipsoid.", | ||
"minimum": 0, | ||
"maximum": 1, | ||
"default": 1 | ||
}, | ||
"minAngle": { | ||
"type": "array", | ||
"description": "The minimum angular bounds of the ellipsoid in radians. The first element corresponds to the azimuthal angle (a.k.a longitude) and must be in the range [-pi, pi]. The second element corresponds to the polar angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2].", | ||
"items": { | ||
"type": "number", | ||
"minimum": -3.14159265359, | ||
"maximum": 3.14159265359, | ||
}, | ||
"minItems": 2, | ||
"maxItems": 2, | ||
"default": [-3.14159265359, -1.57079632679] | ||
}, | ||
"minAngle": { | ||
"type": "array", | ||
"description": "The maximum angular bounds of the ellipsoid in radians. The first element corresponds to the azimuthal angle (a.k.a longitude) and must be in the range [-pi, pi]. The second element corresponds to the polar angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2].", | ||
"items": { | ||
"type": "number", | ||
"minimum": -3.14159265359, | ||
"maximum": 3.14159265359, | ||
}, | ||
"minItems": 2, | ||
"maxItems": 2, | ||
"default": [3.14159265359, 1.57079632679] | ||
}, | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
extensions/2.0/Vendor/EXT_implicit_geometry/schema/ellipsoid.schema.json
This file contains 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,31 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "ellipsoid.schema.json", | ||
"title": "Ellipsoid", | ||
"type": "object", | ||
"description": "An implicit ellipsoid centered at the local space origin.", | ||
"allOf": [ | ||
{ | ||
"$ref": "glTFProperty.schema.json" | ||
} | ||
], | ||
"properties": { | ||
"radii": { | ||
"type": "array", | ||
"description": "The radii of the ellipsoid in meters along the X, Y, and Z axes in local space.", | ||
"items": { | ||
"type": "number", | ||
"minimum": 0 | ||
}, | ||
"minItems": 3, | ||
"maxItems": 3 | ||
}, | ||
"bounds": { | ||
"$ref": "ellipsoid.bounds.schema.json", | ||
"description": "The optional bounds of the ellipsoid." | ||
} | ||
}, | ||
"required": [ | ||
"radii" | ||
] | ||
} |
Oops, something went wrong.