Skip to content

Instantly share code, notes, and snippets.

@pbsds
Last active September 2, 2020 13:42
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 pbsds/46921d3152c0d64598d65dcffca4fd95 to your computer and use it in GitHub Desktop.
Save pbsds/46921d3152c0d64598d65dcffca4fd95 to your computer and use it in GitHub Desktop.
RayGrounds Cornell scene expressed in JSON vs what it could have been using TOML
{
"settings": {
"depth": 3
},
"objects": [
{
"type": "quad",
"translate": [ 1, 0, 1 ],
"scale": [ 2, 2, 1 ],
"rotate": [ 0, 1, 0, -90 ],
"material_property0": [ 0, 1, 0 ]
},
{
"type": "quad",
"translate": [ -1, 0, 1 ],
"scale": [ 2, 2, 1 ],
"rotate": [ 0, 1, 0, 90 ],
"material_property0": [ 1, 0, 0 ]
},
{
"type": "quad",
"translate": [ 0, 1, 1 ],
"scale": [ 2, 2, 1 ],
"rotate": [ 1, 0, 0, 90 ],
"material_property0": [ 0.8, 0.8, 0.8 ]
},
{
"type": "quad",
"translate": [ 0, -1, 1 ],
"scale": [ 2, 2, 1 ],
"rotate": [ 1, 0, 0, -90 ],
"material_property0": [ 0.8, 0.8, 0.8 ]
},
{
"type": "quad",
"translate": [ 0, 0, 2 ],
"scale": [ 2, 2, 1 ],
"rotate": [ 1, 0, 0, 180 ],
"material_property0": [ 1, 1, 1 ]
},
{
"type": "cube",
"translate": [ 0.4, -0.77, 0.6 ],
"scale": [ 0.55, 0.55, 0.55 ],
"rotate": [ 0, 1, 0, 17 ],
"material_property0": [ 0.8, 0.8, 0.8 ]
},
{
"type": "cube",
"translate": [ -0.4, -0.45, 1.3 ],
"scale": [ 0.6, 1.1, 0.6 ],
"rotate": [ 0, 1, 0, -15 ],
"material_property0": [ 0.8, 0.8, 0.8 ],
"material_property1": [ 1, 0, 0 ]
},
{
"type": "sphere",
"translate": [ -0.75, -0.75, 0.5 ],
"radius": 0.25,
"material_property0": [ 1, 1, 0 ]
}
]
}
[settings]
depth = 3
# I modified the schema slightly to make the 'type' a part of the structure
[[object.quad]]
translate = [ 1, 0, 1 ]
scale = [ 2, 2, 1 ]
rotate = [ 0, 1, 0, -90 ]
material_property0 = [ 0, 1, 0 ]
[[object.quad]]
translate = [ -1, 0, 1 ]
scale = [ 2, 2, 1 ]
rotate = [ 0, 1, 0, 90 ]
material_property0 = [ 1, 0, 0 ]
[[object.quad]]
translate = [ 0, 1, 1 ]
scale = [ 2, 2, 1 ]
rotate = [ 1, 0, 0, 90 ]
material_property0 = [ 0.8, 0.8, 0.8 ]
[[object.quad]]
translate = [ 0, -1, 1 ]
scale = [ 2, 2, 1 ]
rotate = [ 1, 0, 0, -90 ]
material_property0 = [ 0.8, 0.8, 0.8 ]
[[object.quad]]
translate = [ 0, 0, 2 ]
scale = [ 2, 2, 1 ]
rotate = [ 1, 0, 0, 180 ]
material_property0 = [ 1, 1, 1 ]
[[object.cube]]
translate = [ 0.4, -0.77, 0.6 ]
scale = [ 0.55, 0.55, 0.55 ]
rotate = [ 0, 1, 0, 17 ]
material_property0 = [ 0.8, 0.8, 0.8 ]
[[object.cube]]
translate = [ -0.4, -0.45, 1.3 ]
scale = [ 0.6, 1.1, 0.6 ]
rotate = [ 0, 1, 0, -15 ]
material_property0 = [ 0.8, 0.8, 0.8 ]
material_property1 = [ 1, 0, 0 ]
[[object.sphere]]
translate = [ -0.75, -0.75, 0.5 ]
radius = 0.25
material_property0 = [ 1, 1, 0 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment