» Back To Index
The <include> node
Function
The include node makes it possible to include other xml Demoniak3D files into another given file. This
functionality gives the possibility to distribute a source code in several files that are much more understandable because
they are smaller.
Each included file is considered as a small library ("lib" to shorten). A lib can contain
other inclusions of libs. The same lib file can be included into several different files: in
this case, the lib will be considered only once. That has the advantage of facilitating the design and
the organization of complex projects.
General syntax
<include
lib="" />
include element
include is the xml tag that defines an include node.
Attributes:
- lib - [STR255] - specifies the name of the file to be included with regard to the current file.
Example
<include lib="logo.xml" />
In general, the "includes" are placed at the beginning of the code, after the <demoniak3d> tag.
A file has the same structure as a standard scene file. Just replace the
demoniak3d tag
by
demoniak3d_lib:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<demoniak3d_lib version="1.0">
<light name="SunLight" type="OMNI" render="FALSE" >
<light_position x="400.0" y="200.0" z="300.0" />
<light_ambient r="0.05" g="0.07" b="0.07" a="1.0" />
<light_diffuse r="0.3" g="0.6" b="0.4" a="1.0" />
<light_specular r="0.3" g="0.5" b="0.2" a="1.0" />
</light>
</demoniak3d_lib>