The scene description language of
Demoniak3D or
DSDL (for Demoniak3D Scene Description Language) is based on the current
XML standard.
The XML language: small recalls
XML documemts are composed of storage spaces, named entities, which contain data. These data are made up of characters strings
which represent the data themselves, and markers as well (still called tags) who are intended to define the logical organization of
the data. The XML format provides a whole of mechanisms to impose constraints on the organization of the data as well as
their logic design.
The principal objectives of the XML formalism are as follows:
- XML must be easily usable on Internet.
- XML must be able to support a great number of applications.
- XML documents must be directly readable by a programmer and reasonably clear as well.
- XML documents must be easy to create.
Edition of a XML file
But what is a XML document exactly? A XML document is a simple text file (which often bears the xml extension) editable with
any text editor.
Caution: softwares such as Microsoft Word are not simple text editors. Indeed, they add a quantity of control and
presentation elements which will disturb and ruin the loading of a 3D scene with Demoniak3D.
If you do not own yet a text editor, here is very powerful an friendly user one:
Notepad++.
It is a completely free text editor. It supports syntactic colouring for the majority of the languages, including XML and LUA.
Notepad++ is integrated in Demoniak3D and may be accessed from the
Tools menu.
The official site of Notepad++ is:
http://notepad-plus.sourceforge.net/.
The updates are regular which is extremely appreciable, thus do have a look from time to time.
In all the cases, the latest version of Notepad++ is always delivered with Demoniak3D.
Structure of a source code in HSDL
A source code (or simply source) in HSDL (thus a XML document) describes the set of data used within the 3d scene in an
arborescent form. A source in HSDL is a textual file bearing the xml extension. This source is composed of 2 principal and
obligatory parts:
Let us see all this more closely. The following example describes a minimal 3d scene: initialization of the scene and the camera.
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<hyperion>
<!--
SCENE node: The scene node describes how the new
window will be (size, background color, ...).
-->
<scene name="hypergraph_01" show_ref_grid="TRUE" >
<background_color r="0.1" g="0.1" b="0.2" />
</scene>
<!--
CAMERA node: A scene can have more than one
camera, but only one is active at a given time.
-->
<camera name="Main_Camera" navigation_mode="FLY" >
<position x="0.0" y="50.0" z="150.0" />
</camera>
</hyperion>
Coding rules
A HSDL source code is a hierarchy of nodes, the node root being materialized by <hyperion>.
All the other nodes contained inside the root node compose the various elements of the 3D scene. The tree structure of nodes
describing a scene is called
HyperGraph:
The 3d scene corresponding to this hypergraph can be as follows:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!--
============================================================
FILE: Simple HyperGraph
AUTHOR: JeGX
DATE: 29.05.2004
PURPOSE: Shows a very simple scene: lighting and 3D model
loading.
This file is part of Demoniak3D Demo-System.
For the latest info, see http://www.oZone3D.net
Copyright (C)2004-2005 The oZone3D Team
===========================================================
-->
<hyperion version="1.0">
<!--
+++++++++++++++++++++++++++++++++++++++[ SCENE ]
-->
<scene name="simple_hypergraph" show_ref_grid="FALSE"
display_fps="TRUE" >
<background_image image="data/luminance.jpg" />
<window_size width="1024" height="768" />
</scene>
<!--
+++++++++++++++++++++++++++++++++++++++[ CAMERA ]
-->
<camera name="myCamera" fov="60.0"
navigation_mode="EXAMINE" >
<position x="0.0" y="50.0" z="150.0" />
<orientation pitch="20.0" yaw="90.0" />
<lookat x="0.0" y="0.0" z="0.0" />
</camera>
<!--
+++++++++++++++++++++++++++++++++++++++[ LIGHT ]
-->
<light name="myLight" type="OMNI" >
<position x="-50.0" y="100.0" z="100.0" />
<diffuse r="1.0" g="1.0" b="1.0" />
</light>
<!--
+++++++++++++++++++++++++++++++++++++++[ MODEL ]
-->
<model name="skullModel"
filename="data/panier/panier.o3mdl"
lighting="TRUE" texturing="TRUE" />
<hyperion>
Loading this source in Demoniak3D gives the following result:
4 - Downloads
| Accompanying project Update: October 17, 2005 |