The SceneGraph3D Description Language

Home About EaZD Deferred renderer API SceneGraph3D API SceneGraph3D scene description language

Index

| Scene file structure | camera | character | directory | eventmessage | group | input | light | linearmotion | material | node | object | proximitytrigger | skylight | spinner | surface | transformation | user | world |

material

Derived from: Group3D
Class name: MaterialAttributes3D
Placement: Anywhere
Description: This group node selectively replaces the material of all its sub-nodes with the one specified by its attributes. This node commonly wraps objects that have no material specification (e.g. surface primitives). The "which" attribute specifies the indices or material names that should be replaced.
Special notes: -
Inherited attributes: name, active, visible (active and visible refer the whole hierarchy stemming from this node)
New attributes:
attribute type description
ambient VEC3 The ambient component of the material.
diffuse VEC3 The diffuse color (albedo) of the material.
specular VEC3 The relfective (specular) highlight color of the material.
alpha FLOAT The opacity of the material.
shininess INTEGER The specular exponent of the material. Valid range same as that of OpenGL.
metallic_shine FLOAT Metallic shininess. Not used in this version.
ior FLOAT Index of refraction. Not used in this version.
which INTEGER ARRAY / STRING ARRAY Specifies the indices of the materials in the sub-tree to be replaced by the attributes of the current material node. Alternatively, the names of the materials can be given instead.
Events:
event name condition
- -
Inherited events: -
New messages:
attribute value description
- - -
Inherited messages: -
Redefined messages: -
Obsolete messages: active, visible, hide, show, deactivate, enable, activate, disable


Example

<world ambient_occlusion="ssao" bloom="yes" shadows="disk" 
       ao_radius="6" ambient="0.3 0.3 0.3" defocus="yes">
  
    <camera name="first_person" apperture="50.0" 
            focal_distance ="30.0" focal_range="30.0"
            near="2.0" far="1000" follow="Myself" primary="true">
    </camera> 
    
    <material ambient="0.2 0.2 0.2" diffuse="1.0 0.5 0.0" specular="1.0 1.0 1.0"
emission="0.0 1.0 1.0" alpha="1" shininess="64"
which="0">
<surface name="torus" type="torus" radius="2.5" depth="5"/> </material>
<user name="Myself" control="navigate" speed="2.0" turn="0.5" position="0,10,100" lookat="0,10,0" input="Console"> </user> <input name="Console" type="mousekeyboard"> </input> </world>

Last update: 6 Feb. 2009