-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Get the main IMML specification library from NuGet: http://nuget.org/List/Packages/Imml
You may also be interested in the Imml.Runtime package which simplifies integration with 3D renderers: https://www.nuget.org/packages/Imml.Runtime/
At its simplest form, the IMML library is used to read an IMML file into an object representation, like this:
var immlSerialiser = new ImmlSerialiser();
var document = immlSerialiser.Read<ImmlDocument>(stream);
foreach (var element in document.Elements)
{
//do something with the element
}
It can also be used in the other direction, to write an object model to a string/stream:
var immlDocument = new ImmlDocument();
var model = new Model();
var primitive = new Primitive();
var camera = new Camera();
primitive.Add(camera);
model.Add(primitive);
immlDocument.Add(model);
using (var fs = new FileStream(@"C:\my.imml", FileMode.Create))
{
var immlSerialiser = new ImmlSerialiser();
immlSerialiser.Write(immlDocument, fs);
}
Custom IElementFactory implementations may be provided to the ImmlSerialiser which alter the objects that are instantiated for each element.
This allows objects to be created as they are read from the document and resources in your engine to be allocated as soon as that element is known.
var customElementFactory = new CustomElementFactory(); //implementation of IElementFactory
var immlSerialiser = new ImmlSerialiser(customElementFactory);
var immlDocument = immlSerialiser.Read<ImmlDocument>(stream);
The original implementation of IMML existed within the VastPark platform which ceased being actively developed circa 2012 - VastPark had been making use of IMML as the world description since it was authored in 2007!
A related project ImmlPad is a lightweight editor that made scene design simple.
Here are some screenshots of environments that have been described using IMML.
The atrium, Sponza Palace
Fire training demonstration
Architecture, interior visualisation
Architecture, exterior visualisation
Flight simulators
Urban simulations
Machinima