Skip to content

Commit dc1029a

Browse files
committed
Add EXT_implicit_geometry
1 parent c805aaf commit dc1029a

15 files changed

+655
-26
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
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.
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "box.schema.json",
4+
"title": "Box",
5+
"type": "object",
6+
"description": "An implicit box centered at the local space origin.",
7+
"allOf": [
8+
{
9+
"$ref": "glTFProperty.schema.json"
10+
}
11+
],
12+
"properties": {
13+
"size": {
14+
"type": "array",
15+
"description": "The size of the box in three dimensions.",
16+
"items": {
17+
"type": "number"
18+
},
19+
"minItems": 3,
20+
"maxItems": 3
21+
},
22+
"bounds": {
23+
"$ref": "box.bounds.schema.json",
24+
"description": "The optional bounds of the box."
25+
}
26+
},
27+
"required": [
28+
"size"
29+
]
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "cylinder.bounds.schema.json",
4+
"title": "Cylinder Bounds",
5+
"type": "object",
6+
"description": "A set of bounds for an implicit cylinder surface. Defines the subsection of the cylinder that the implicit volume actually occupies.",
7+
"allOf": [
8+
{
9+
"$ref": "glTFProperty.schema.json"
10+
}
11+
],
12+
"properties": {
13+
"minRadius": {
14+
"type": "number",
15+
"description": "The minimum radial bound of the cylinder.",
16+
"minimum": 0,
17+
"maximum": 1,
18+
"default": 0
19+
},
20+
"maxRadius": {
21+
"type": "number",
22+
"description": "The maximum radial bound of the cylinder.",
23+
"minimum": 0,
24+
"maximum": 1,
25+
"default": 1
26+
},
27+
"minHeight": {
28+
"type": "number",
29+
"description": "The minimum height bound of the cylinder.",
30+
"minimum": 0,
31+
"maximum": 1,
32+
"default": 0
33+
},
34+
"maxHeight": {
35+
"type": "number",
36+
"description": "The maximum height bound of the cylinder.",
37+
"minimum": 0,
38+
"maximum": 1,
39+
"default": 1
40+
},
41+
"minAngle": {
42+
"type": "number",
43+
"description": "The maximum angular bound of the cylinder in radians. Values must be in the range [-pi, pi].",
44+
"minimum": -3.14159265359,
45+
"maximum": 3.14159265359,
46+
"default": -3.14159265359
47+
},
48+
"maxAngle": {
49+
"type": "number",
50+
"description": "The maximum angular bound of the cylinder in radians. Values must be in the range [-pi, pi].",
51+
"minimum": -3.14159265359,
52+
"maximum": 3.14159265359,
53+
"default": 3.14159265359
54+
}
55+
}
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "cylinder.schema.json",
4+
"title": "Cylinder",
5+
"type": "object",
6+
"description": "An implicit cylinder centered at the local space origin.",
7+
"allOf": [
8+
{
9+
"$ref": "glTFProperty.schema.json"
10+
}
11+
],
12+
"properties": {
13+
"radius": {
14+
"type": "number",
15+
"description": "The radius of the cylinder in local space.",
16+
"minimum": 0
17+
},
18+
"height": {
19+
"type": "number",
20+
"description": "The height of the cylinder in local space.",
21+
"minimum": 0
22+
},
23+
"bounds": {
24+
"$ref": "cylinder.bounds.schema.json",
25+
"description": "The optional bounds of the cylinder."
26+
}
27+
},
28+
"required": [
29+
"radius",
30+
"height"
31+
]
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "ellipsoid.bounds.schema.json",
4+
"title": "Ellipsoid Bounds",
5+
"type": "object",
6+
"description": "A set of bounds for an implicit ellipsoid surface. Defines the subsection of the ellipsoid that the implicit volume actually occupies.",
7+
"allOf": [
8+
{
9+
"$ref": "glTFProperty.schema.json"
10+
}
11+
],
12+
"properties": {
13+
"minRadius": {
14+
"type": "number",
15+
"description": "The minimum radial bound of the ellipsoid.",
16+
"minimum": 0,
17+
"maximum": 1,
18+
"default": 0
19+
},
20+
"maxRadius": {
21+
"type": "number",
22+
"description": "The maximum radial bound of the ellipsoid.",
23+
"minimum": 0,
24+
"maximum": 1,
25+
"default": 1
26+
},
27+
"minAngle": {
28+
"type": "array",
29+
"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].",
30+
"items": {
31+
"type": "number",
32+
"minimum": -3.14159265359,
33+
"maximum": 3.14159265359,
34+
},
35+
"minItems": 2,
36+
"maxItems": 2,
37+
"default": [-3.14159265359, -1.57079632679]
38+
},
39+
"minAngle": {
40+
"type": "array",
41+
"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].",
42+
"items": {
43+
"type": "number",
44+
"minimum": -3.14159265359,
45+
"maximum": 3.14159265359,
46+
},
47+
"minItems": 2,
48+
"maxItems": 2,
49+
"default": [3.14159265359, 1.57079632679]
50+
},
51+
}
52+
}

0 commit comments

Comments
 (0)