Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add JSONObject Attribute to batchTable #65

Merged
merged 1 commit into from
Feb 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions TileFormats/Batched3DModel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ The batch table maps each `batchId` to per-model properties. If present, the ba

The batch table is a `UTF-8` string containing JSON. It immediately follows the header. It can be extracted from the arraybuffer using the `TextDecoder` JavaScript API and transformed to a JavaScript object with `JSON.parse`.

Each property in the object is an array with its length equal to `header.batchLength`. Each array is a homogeneous collection of `String`, `Number`, or `Boolean` elements. Elements may be `null`.
Each property in the object is an array with its length equal to `header.batchLength`. Each array is a homogeneous collection of `String`, `Number`, `Boolean` or `JSONObject` 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.
```json
{
"id" : ["unique id", "another unique id"],
"displayName" : ["Building name", "Another building name"],
"yearBuilt" : [1999, 2015]
"yearBuilt" : [1999, 2015],
"address":[{"street":"Main Street", "HouseNumber":"1"}, {"street":"Main Street", "HouseNumber":"2"}]
}
```

Expand All @@ -61,13 +62,15 @@ The properties for the model with `batchId = 0` are
id[0] = 'unique id';
displayName[0] = 'Building name';
yearBuilt[0] = 1999;
address[0] = {"street":"Main Street", "HouseNumber":"1"};
```

The properties for `batchId = 1` are
```javascript
id[1] = 'another unique id';
displayName[1] = 'Another building name';
yearBuilt[1] = 2015;
address[1] = {"street":"Main Street", "HouseNumber":"2"};
```

## Binary glTF
Expand Down