<p>The <code>min</code> and <code>max</code> values provide an outer bounding box for all <code>POSITION</code> data within a given accessor.  Accessors typically contain multiple vertices, for example all of the vertices of a particular primitive, and then <code>min: [x, y, z]</code> and <code>max: [x, y, z]</code> will offer the bounding box for that primitive.</p>
<p>For your second question, let's look at the mesh structure from <a href="https://github.com/KhronosGroup/glTF-Sample-Models/blob/0bc74b12b2de22a1267ccab819efcf8c6a4f3dc8/2.0/BoxTextured/glTF/BoxTextured.gltf#L44-L56" rel="nofollow noreferrer">BoxTextured.gltf</a>:</p>
<pre><code>&quot;meshes&quot;: [
    {
        &quot;primitives&quot;: [
            {
                &quot;attributes&quot;: {
                    &quot;NORMAL&quot;: 1,
                    &quot;POSITION&quot;: 2,
                    &quot;TEXCOORD_0&quot;: 3
                },
                &quot;indices&quot;: 0,
                &quot;mode&quot;: 4,
                &quot;material&quot;: 0
            }
        ],
        &quot;name&quot;: &quot;Mesh&quot;
    }
],
</code></pre>
<p>In the above example, <code>mode: 4</code> is an enum, where <code>4</code> means <code>TRIANGLES</code>.  The <code>indices</code> are stored in accessor <code>0</code>, and the <code>POSITION</code> data is stored in accessor <code>2</code>.  So, accessor <code>2</code> will contain a list of vertex positions, but each vertex is allowed to be referenced by multiple triangles.  The indices in accessor <code>0</code> declare the triangles by indexing into the list of vertices.</p>
<p>Here's a sample of the start of accessor <code>0</code> from this model:</p>
<pre><code>0 
1 
2 

3 
2 
1 

4 
5 
6 

7 
6 
5 
...
</code></pre>
<p>And this is a sample of the contents from the start of accessor <code>2</code> in this model:</p>
<pre><code>-0.50000    -0.50000     0.50000 
 0.50000    -0.50000     0.50000 
-0.50000     0.50000     0.50000 
 0.50000     0.50000     0.50000 
 0.50000     0.50000     0.50000 
 0.50000    -0.50000     0.50000 
 0.50000     0.50000    -0.50000 
 0.50000    -0.50000    -0.50000 
 ...
</code></pre>
<p>In this manner, the sample model builds a cube by winding triangles around vertices at the corners.</p>
<p>For a more graphical explanation of this, check out the <a href="https://raw.githubusercontent.com/KhronosGroup/glTF/main/specification/2.0/figures/gltfOverview-2.0.0b.png" rel="nofollow noreferrer">glTF Overview Card</a> - same image is found <a href="https://github.com/KhronosGroup/glTF#overview" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 3.0
2018-04-17T20:43:54.493Z
Thank you for your answer ! But now I would like to ask if the min and max values are just bounding boxes, where the actual coords of the vertices ?
Vettel.Sebastian
CC BY-SA 3.0
2018-04-17T21:24:14.403Z
glTF stores the actual mesh data in a binary chunk.  This can be delivered a number of ways: As a separate .bin file, as a base64-encoded blob inside the JSON, or as a binary section of a .glb file.  Each `accessor` points to a `bufferView`, and typically each `bufferView` references a `buffer` with a single binary data blob.  So, the accessors and bufferViews act to slice portions of data out of the binary blob.
emackey
CC BY-SA 3.0
2018-04-18T05:17:40.867Z
Thanks again, so I need to look for the coordinates in the binary file somehow.
Vettel.Sebastian
CC BY-SA 3.0
2018-04-18T09:46:57.143Z
How did you get the values from the acessors ?
Vettel.Sebastian
CC BY-SA 3.0
2018-04-18T15:02:42.903Z
I'm using the [glTF Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=cesium.gltf-vscode) (Disclaimer, I'm a contributor).  Place the cursor inside an accessor block and press ALT+D to decode the binary.
emackey
CC BY-SA 4.0
2022-12-14T07:23:30.210Z
it's important to keep in mind that the actual coordinates are not sored in the `.gltf` file. As mentioned in the [comment](https://computergraphics.stackexchange.com/users/1908/emackey), they are typically stored in a separate file. And the shortcut `Alt + D` in the [glTF Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=cesium.gltf-vscode) is a great way to find that data
Gangula
CC BY-SA 4.0
2018-04-17T19:51:09.247Z
2022-12-14T08:59:44.623Z
2022-12-14T08:59:44.623Z
emackey
<p>I've read the reference guide about the file but I am really confused. Why the hell are there "min" and "max" values ?? A single vertex has only one coordinate array not min and max..</p>

<p>Also in the structure of the meshes why is there an "indices" reference to the "accessors" if we already put the indices to the "attributes" like "NORMAL: 2"? </p>

<gltf>
How mesh geometry data (vertex coordinates) stored in glTF?
Vettel.Sebastian
# How mesh geometry data (vertex coordinates) stored in glTF?

(Asked by: username_0 on 2018-04-17)

I've read the reference guide about the file but I am really confused. Why the hell are there "min" and "max" values ?? A single vertex has only one coordinate array not min and max..

Also in the structure of the meshes why is there an "indices" reference to the "accessors" if we already put the indices to the "attributes" like "NORMAL: 2"?

**Tags:** gltf


---

## 1 answers

### Answer by username_1 on 2018-04-17. Score: 3 | Accepted answer

The `min` and `max` values provide an outer bounding box for all `POSITION` data within a given accessor. Accessors typically contain multiple vertices, for example all of the vertices of a particular primitive, and then `min: [x, y, z]` and `max: [x, y, z]` will offer the bounding box for that primitive.

For your second question, let's look at the mesh structure from [BoxTextured.gltf](https://github.com/KhronosGroup/glTF-Sample-Models/blob/0bc74b12b2de22a1267ccab819efcf8c6a4f3dc8/2.0/BoxTextured/glTF/BoxTextured.gltf#L44-L56):

```
"meshes": [
    {
        "primitives": [
            {
                "attributes": {
                    "NORMAL": 1,
                    "POSITION": 2,
                    "TEXCOORD_0": 3
                },
                "indices": 0,
                "mode": 4,
                "material": 0
            }
        ],
        "name": "Mesh"
    }
],

```

In the above example, `mode: 4` is an enum, where `4` means `TRIANGLES`. The `indices` are stored in accessor `0`, and the `POSITION` data is stored in accessor `2`. So, accessor `2` will contain a list of vertex positions, but each vertex is allowed to be referenced by multiple triangles. The indices in accessor `0` declare the triangles by indexing into the list of vertices.

Here's a sample of the start of accessor `0` from this model:

```
0 
1 
2 

3 
2 
1 

4 
5 
6 

7 
6 
5 
...

```

And this is a sample of the contents from the start of accessor `2` in this model:

```
-0.50000    -0.50000     0.50000 
 0.50000    -0.50000     0.50000 
-0.50000     0.50000     0.50000 
 0.50000     0.50000     0.50000 
 0.50000     0.50000     0.50000 
 0.50000    -0.50000     0.50000 
 0.50000     0.50000    -0.50000 
 0.50000    -0.50000    -0.50000 
 ...

```

In this manner, the sample model builds a cube by winding triangles around vertices at the corners.

For a more graphical explanation of this, check out the [glTF Overview Card](https://raw.githubusercontent.com/KhronosGroup/glTF/main/specification/2.0/figures/gltfOverview-2.0.0b.png) - same image is found [here](https://github.com/KhronosGroup/glTF#overview).

> **Comments:**
> **username_0**: Thank you for your answer ! But now I would like to ask if the min and max values are just bounding boxes, where the actual coords of the vertices ?  
> **username_1**: glTF stores the actual mesh data in a binary chunk.  This can be delivered a number of ways: As a separate .bin file, as a base64-encoded blob inside the JSON, or as a binary section of a .glb file.  Each `accessor` points to a `bufferView`, and typically each `bufferView` references a `buffer` with a single binary data blob.  So, the accessors and bufferViews act to slice portions of data out of the binary blob.  
> **username_0**: Thanks again, so I need to look for the coordinates in the binary file somehow.  
> **username_0**: How did you get the values from the acessors ?  
> **username_1**: I'm using the [glTF Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=cesium.gltf-vscode) (Disclaimer, I'm a contributor).  Place the cursor inside an accessor block and press ALT+D to decode the binary.  
> **username_2**: it's important to keep in mind that the actual coordinates are not sored in the `.gltf` file. As mentioned in the [comment](https://computergraphics.stackexchange.com/users/1908/username_1), they are typically stored in a separate file. And the shortcut `Alt + D` in the [glTF Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=cesium.gltf-vscode) is a great way to find that data  

---

