|
| 1 | +# EXT_implicit_geometry |
| 2 | + |
| 3 | +## Contributors |
| 4 | +- Sean Lilley, Cesium |
| 5 | +- Janine Liu, Cesium |
| 6 | + |
| 7 | +## Status |
| 8 | +Draft |
| 9 | + |
| 10 | +## Dependencies |
| 11 | +Written against the glTF 2.0 specification. |
| 12 | + |
| 13 | +## Overview |
| 14 | + |
| 15 | +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 and instead use the extension to infer the implicit 3D volume. |
| 16 | + |
| 17 | +The following example illustrates how a primitive with this extension may represent an implicit box. |
| 18 | + |
| 19 | +``` |
| 20 | +{ |
| 21 | + "primitives": [ |
| 22 | + { |
| 23 | + "extensions": { |
| 24 | + "EXT_implicit_geometry": { |
| 25 | + "box": { |
| 26 | + "size": [2, 2, 2] |
| 27 | + } |
| 28 | + } |
| 29 | + } |
| 30 | + } |
| 31 | + ] |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +Primitives with this extension may still be affected by node transforms to position, orient, and scale the shape as needed. |
| 36 | + |
| 37 | +## Supported Geometry |
| 38 | + |
| 39 | +Currently, this extension supports the following implicit geometries: |
| 40 | +- [`box`](#box) |
| 41 | +- [`cylinder`](#cylinder) |
| 42 | +- [`sphere`](#sphere) |
| 43 | +- [`ellipsoid`](#ellipsoid) |
| 44 | +- [`region`](#region) |
| 45 | + |
| 46 | +Only **one** shape may be defined at a time. |
| 47 | + |
| 48 | +By default, the implicit 3D volume is assumed to fill the entire shape specified in the extension. However, each shape allows an optional `slice` 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 `slice` can limit the volume to be only half of the full sphere. |
| 49 | + |
| 50 | +### Box |
| 51 | + |
| 52 | +The `box` property represents an axis-aligned box that is centered at the origin. The `size` property indicates its size in meters along the `x`, `y`, and `z` axes. |
| 53 | + |
| 54 | +<table> |
| 55 | + <tr> |
| 56 | + <th> |
| 57 | + Example |
| 58 | + </th> |
| 59 | + <th> |
| 60 | + Visual |
| 61 | + </th> |
| 62 | + </tr> |
| 63 | + <tr> |
| 64 | + <td><pre> |
| 65 | + "primitives": [ |
| 66 | + { |
| 67 | + "extensions": { |
| 68 | + "EXT_implicit_geometry": { |
| 69 | + "box": { |
| 70 | + "size": [1, 0.5, 2], |
| 71 | + } |
| 72 | + } |
| 73 | + } |
| 74 | + } |
| 75 | + ] |
| 76 | + </pre></td> |
| 77 | + <td> |
| 78 | + <img width="600px" src="figures/non-uniform-box.png"/> |
| 79 | + </td> |
| 80 | + </tr> |
| 81 | +</table> |
| 82 | + |
| 83 | +### Cylinder |
| 84 | + |
| 85 | +The `cylinder` property represents a cylinder that is aligned with the `y`-axis and centered at the origin. The `radius` and `height` properties indicate the dimensions of the cylinder in meters. |
| 86 | + |
| 87 | +<table> |
| 88 | + <tr> |
| 89 | + <th> |
| 90 | + Example |
| 91 | + </th> |
| 92 | + <th> |
| 93 | + Visual |
| 94 | + </th> |
| 95 | + </tr> |
| 96 | + <tr> |
| 97 | + <td><pre> |
| 98 | + "primitives": [ |
| 99 | + { |
| 100 | + "extensions": { |
| 101 | + "EXT_implicit_geometry": { |
| 102 | + "cylinder": { |
| 103 | + "radius": 2, |
| 104 | + "height": 3 |
| 105 | + } |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | + ] |
| 110 | + </pre></td> |
| 111 | + <td> |
| 112 | + **TODO** visual example |
| 113 | + </td> |
| 114 | + </tr> |
| 115 | +</table> |
| 116 | + |
| 117 | +### Sphere |
| 118 | + |
| 119 | +The `sphere` property represents a sphere that is centered at the origin. The `radius` of the sphere is specified in meters. |
| 120 | + |
| 121 | +<table> |
| 122 | + <tr> |
| 123 | + <th> |
| 124 | + Example |
| 125 | + </th> |
| 126 | + <th> |
| 127 | + Visual |
| 128 | + </th> |
| 129 | + </tr> |
| 130 | + <tr> |
| 131 | + <td><pre> |
| 132 | + "primitives": [ |
| 133 | + { |
| 134 | + "extensions": { |
| 135 | + "EXT_implicit_geometry": { |
| 136 | + "sphere": { |
| 137 | + "radius": 2, |
| 138 | + } |
| 139 | + } |
| 140 | + } |
| 141 | + } |
| 142 | + ] |
| 143 | + </pre></td> |
| 144 | + <td> |
| 145 | + **TODO** visual example |
| 146 | + </td> |
| 147 | + </tr> |
| 148 | +</table> |
| 149 | + |
| 150 | +### Ellipsoid |
| 151 | + |
| 152 | +The `ellipsoid` property represents an ellipsoid that is centered at the origin. The `radii` property indicates the radii of the ellipsoid in meters along the `x`, `y`, and `z` axes. |
| 153 | + |
| 154 | +**TODO** visual example |
| 155 | + |
| 156 | +<table> |
| 157 | + <tr> |
| 158 | + <th> |
| 159 | + Example |
| 160 | + </th> |
| 161 | + <th> |
| 162 | + Visual |
| 163 | + </th> |
| 164 | + </tr> |
| 165 | + <tr> |
| 166 | + <td><pre> |
| 167 | + "primitives": [ |
| 168 | + { |
| 169 | + "extensions": { |
| 170 | + "EXT_implicit_geometry": { |
| 171 | + "ellpisoid": { |
| 172 | + "radii": [2, 3, 4] |
| 173 | + } |
| 174 | + } |
| 175 | + } |
| 176 | + } |
| 177 | + ] |
| 178 | + </pre></td> |
| 179 | + <td> |
| 180 | + **TODO** visual example |
| 181 | + </td> |
| 182 | + </tr> |
| 183 | +</table> |
| 184 | +``` |
| 185 | +
|
| 186 | +### Region |
| 187 | +
|
| 188 | +The `region` property represents a region above the surface of an ellipsoid. Though the ellipsoid itself is centered at the origin, the region may be distant from the origin due to its properties. |
| 189 | +
|
| 190 | +The `semiMajorAxis` property indicates the radii of the ellipsoid in meters along the `x`, `y`, and `z` axes. |
| 191 | +
|
| 192 | +## Optional vs. Required |
| 193 | +This extension is required, meaning it should be placed in both the `extensionsUsed` list and `extensionsRequired` list. |
0 commit comments