scene Element Reference

Contains all shape and material data representing the virtual scene. More...

List of all members.

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.'
typematerial
occurrenceszero or more
defaultdefault 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)
"type" : "oriented",
"power" : [ 80, 80, 80 ],
},

// subnodes to which this material is applied
"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.

typetransform
occurrenceszero or more
defaultinherits 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.
typeshape
occurrenceszero or more

Example usage:

"scene" : {
// declare the same sphere centered at the origin two different ways
"shape" : { "type" : "sphere" },
"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
"bsdf" : { "type" : "diffuse", "kd" : [ 1, 0, 0 ], },
"medium" : { "ior" : 1.49 },

"translate" : [ 0, 5, 0 ],
"shape" : { "instance" : "myMesh" },
},
},
},


Generated on 28 Feb 2009 for MiltonScenefileFormat by doxygen 1.5.6