Skip to content

Instantly share code, notes, and snippets.

@xoofx
Last active December 24, 2015 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xoofx/6729956 to your computer and use it in GitHub Desktop.
Save xoofx/6729956 to your computer and use it in GitHub Desktop.
This is a translation of the JSDL sample from the JSON Description Language http://area.autodesk.com/blogs/chris/json-scene-description-language. You can copy paste the following YAML grammar on an online YAML parser (like http://yaml-online-parser.appspot.com/ )
# YAML Version of the JSDL Autodesk example http://area.autodesk.com/blogs/chris/json-scene-description-language
# This version is using flow nodes [ ] { } like JSON but is less verbose by removing all double quotes
{
id: my_scene,
roots: [
{
assets: [Square],
children: [
{
transform:
[
1, 0, 0, 3,
0, 1, 0, 4,
0, 0, 1, 5,
0, 0, 0, 1
],
assets: [Square],
}
],
}
],
assets: [
Square: {
representations: [
threejs.geometry.json,
wavefront.obj,
alembic],
default: {
type: threejs.geometry.json,
value: {
vertexes: [
[-1, 1, 0],
[1, 1, 0],
[1, -1, 0],
[-1, -1, 0],
],
faces: [
[3, 2, 1],
[3, 1, 0],
]
}
}
}
]
}
# YAML Version of the JSDL Autodesk example http://area.autodesk.com/blogs/chris/json-scene-description-language
# This version is using whitespace structured document (as python) mixed with some inline lists []
id: my_scene,
roots:
- assets: [Square]
children:
- transform:
[
1, 0, 0, 3,
0, 1, 0, 4,
0, 0, 1, 5,
0, 0, 0, 1
]
assets: [Square]
assets:
- Square:
representations:
- threejs.geometry.json,
- wavefront.obj,
- alembic
default:
type: threejs.geometry.json,
value:
vertexes: [
[-1, 1, 0],
[1, 1, 0],
[1, -1, 0],
[-1, -1, 0],
]
faces: [
[3, 2, 1],
[3, 1, 0],
]
{
"id" : "my_scene"
"roots" : [
{
"assets" : ["Square"],
"children" :
[
"transform" :
[
1, 0, 0, 3,
0, 1, 0, 4,
0, 0, 1, 5,
0, 0, 0, 1
]
"assets" : ["Square"],
],
}
],
"assets" : [
"Square" : {
"representations" : [
"threejs.geometry.json",
"wavefront.obj",
"alembic"],
"default" : {
"type" : "threejs.geometry.json",
"value" : {
"vertexes" : [
[-1, 1, 0],
[1, 1, 0],
[1, -1, 0],
[-1, -1, 0],
],
"faces": [
[3, 2, 1],
[3, 1, 0],
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment