Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
slchow committed Aug 3, 2015
1 parent cb3936f commit 542a26f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions b3dm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

_Batched 3D Model_ allows offline batching of heterogeneous 3D models, such as different buildings in a city, for efficient streaming to a web client for rendering and interaction. Efficiency comes from transfering multiple models in a single request and rendering them in the least number of WebGL draw calls necessary.

Per-model IDs and metadata enable individual models to be identified and updated at runtime, e.g., show/hide, hightlight color, etc., and enable individual models to reference properties, for example, to query REST services, for display, or for updating, e.g., changing highlight color based on a property value.
Per-model IDs and metadata enable individual models to be identified and updated at runtime, e.g., show/hide, highlight color, etc. They also enable individual models to reference properties such as REST services for display or for updating, e.g., changing highlight color based on a property value.

Batched 3D Model, or just the _batch_, is a binary blob in little endian accessed in JavaScript as an `ArrayBuffer`.

Expand All @@ -24,8 +24,8 @@ Batched 3D Model, or just the _batch_, is a binary blob in little endian accesse
The 12-byte header contains:

* `magic` - 4-byte ANSI string `b3dm`. This can be used to identify the arraybuffer as Batched 3D Model.
* `version` - `uint32` that contains the version of the Batched 3D Model format, which is currently `1`.
* `batchTableLength` - `uint32` that contains the length of the batch table. It may be zero indicating there is not a batch table.
* `version` - `uint32`, which contains the version of the Batched 3D Model format. It is currently `1`.
* `batchTableLength` - `uint32`, which contains the length of the batch table. It may be zero indicating there is not a batch table.

_TODO: code example reading header_

Expand All @@ -39,7 +39,7 @@ The batch table is a `UTF-8` string containing JSON. It can be extracted from t

Each property in the object is an array with its length equal to the number of models in the batch. Each array is a homogeneous collection of `String`, `Number`, or `Boolean` elements. Elements may be `null`.

A vertex's `batchId` is used to access elements in each array, and extract the corresponding properties. For example, the following batch table has properties for a batch of two models.
A vertex's `batchId` is used to access elements in each array and extract the corresponding properties. For example, the following batch table has properties for a batch of two models.
```json
{
"id" : ["unique id", "another unique id"],
Expand All @@ -48,14 +48,14 @@ A vertex's `batchId` is used to access elements in each array, and extract the c
}
```

The properties for the model with `batchId = 0` are:
The properties for the model with `batchId = 0` are
```javascript
id[0] = 'unique id';
displayName[0] = 'Building name';
yearBuilt[0] = 1999;
```

The properties for `batchId = 1` are:
The properties for `batchId = 1` are
```javascript
id[1] = 'another unique id';
displayName[1] = 'Another building name';
Expand All @@ -66,9 +66,9 @@ yearBuilt[1] = 2015;

[glTF](https://www.khronos.org/gltf) is the runtime asset format for WebGL. [Binary glTF](https://github.com/KhronosGroup/glTF/blob/new-extensions/extensions/CESIUM_binary_glTF/README.md) is an extension defining a binary container for glTF.

Binary glTF immediately follows the batch table. It begins `12 + batchTableLength` bytes from the start of the arraybuffer and continues for the rest of arraybuffer. It may embed all of its geometry, texture, and animations or may refer to external sources for some or all of these data.
Binary glTF immediately follows the batch table. It begins `12 + batchTableLength` bytes from the start of the arraybuffer and continues for the rest of arraybuffer. It may embed all of its geometry, texture, and animations, or it may refer to external sources for some or all of these data.

As described above, each vertex has a `batchId` attribute indicating the model to which it belongs. For example, vertices for a batch with three models may look like:
As described above, each vertex has a `batchId` attribute indicating the model to which it belongs. For example, vertices for a batch with three models may look like this:
```
batchId: [0, 0, 0, ..., 1, 1, 1, ..., 2, 2, 2, ...]
position: [xyz, xyz, xyz, ..., xyz, xyz, xyz, ..., xyz, xyz, xyz, ...]
Expand Down

0 comments on commit 542a26f

Please sign in to comment.