scene Element Reference
Contains all shape and material data representing the virtual scene. More...
Attributes | |
| material | material |
| Declares a material which will be applied to all subshapes. | |
| transform | transform |
| Declares a transformation block which affects all subnodes. | |
| shape | shape |
| Declares a shape node. | |
Detailed Description
Contains all shape and material data representing the virtual scene.The scene element is composed of zero or more 'nodes' and possibly a background element, where a 'node' is either a material, transform, or shape element.
- Note:
- scene corresponds to the underlying Milton class 'Scene.'
Attribute Documentation
Declares a material which will be applied to all subshapes.
- Note:
- material corresponds to the underlying Milton class 'Material.'
| type | material |
| occurrences | zero or more |
| default | default material applied to any object will be constant gray, and diffuse |
Example usage:
"material": {
// this example material declares a planar area light source
// declare reflectivity (optional)
"bsdf" : {
"type" : "diffuse",
"kd"
: 0.5,
},
// declare emittance (optional)
"emitter" : {
"type" : "oriented",
"power" : [ 80, 80, 80 ],
},
// subnodes to which this material is applied
"transform" : {
"translate" : [ 0, 1, 0 ],
// rotate plane to face downwards towards origin
"rotate" : [ 0, 0, 0, 1, 0, 0, 180 ],
"scale" : [ .75, 1, .75 ],
"plane" : { },
},
},
Declares a transformation block which affects all subnodes.
| type | transform |
| occurrences | zero or more |
| default | inherits transform from parent element (which can, itself, be a transform block); at top-level scene, default transform is the identity |
Example usage:
"transform" : {
// scale a unit cube uniformly by 1/2, then rotate about the x-axis by 90 degrees,
// then translate up three units about the new x axis
// note: if multiple transformations are listed in a single transform block,
// all rotations will be applied first, then all scales, then all translations
"translate" : [ 3, 0, 0 ],
"rotate" : [ 0, 0, 0, 1, 0, 0, 90 ],
"scale" : [ .5, .5, .5 ],
// cube in unit box from [ -.5, -.5, -.5 ] to [ .5, .5, .5 ]
"cube" : { }
// ... (elided) other nodes which this transform should be applied to
},
Declares a shape node.
- Note:
- Aggregate shapes such as shapeSet may contain child materials and transforms.
| type | shape |
| occurrences | zero or more |
Example usage:
"scene" : {
// declare the same sphere centered at the origin two different ways
"sphere" : { },
// declare a mesh
"mesh" : {
"path" : "path/to/mesh.obj", // ply or obj mesh
"name" : "myMesh", // optionally specify a name
},
// declare a translated mesh instance with a different material
"material" : {
"medium" : { "ior" : 1.49 },
"transform" : {
"translate" : [ 0, 5, 0 ],
"shape" : { "instance" : "myMesh" },
},
},
},
Generated on 28 Feb 2009 for MiltonScenefileFormat by
1.5.6