Flatland

3DML Tag Guide

This reference guide provides the details of the syntax for each of the 3DML tags. A thorough description of the blocks available can be found in the Blockset Guides. These guides are designed to be used in conjunction with the 3DML Tutorial, which gives step-by-step instructions on how to build a spot. It is advisable to complete the tutorial first.

3DML is a markup language that describes three-dimensional spaces (called spots) that are viewable with the Flatland Rover. Wherever possible, 3DML syntax is identical to or as similar to HTML syntax as possible. In some cases, however, we chose to make things a little different from HTML in order to retain XML compliance.

This guide is current for Rover version 3.4.

The code samples provided here are given in an extended form with line breaks between tag properties to make them easy to read. Please note, however, that in 3DML you can write tags either way, as long one line tags, or with line breaks as used in this reference. Also, spaces have been added before and after the enclosing brackets to insure they are displayed properly on the page. These spaces are not to be used in the actual tags.

General Rules About 3DML Tags

One line tags follow this basic syntax:

< tag attribute="value" />

Tags that bound other groups of tags follow this basic syntax:

< tag1 attribute="value">
< tag2 attribute="value" />
< /tag1>

The tags that can bound other tags are:

< spot >, < head >, < body >, < create >, < action >, < imagemap >, < define >

All tags must be bounded by <>. Tags and attributes are not case sensitive, but opening and closing tags must be in the same case. This reference uses lowercase tags and attributes for consistancy.

All values, meaning anything immediately following an equals sign(=) must be surrounded by quotes(”). Any value that describes an x,y or x,y,z coordinate must be bounded by parentheses ( ). R,G,B color values also must be bounded by parentheses ( ).

To include comments in a 3DML file, use the following syntax:

< ! -- your comments here -- >

Any information bounded in this way will be ignored by Rover. Avoid using multiple, consecutive dashes (–) in comments for XML compliance.

Basic structure of a 3DML file

The < spot > tag

< spot version="current_version_number" > … < /spot >

The first and last tags in a 3DML file. Everything between these tags is considered to be a spot described in the 3DML format. The version parameter specifies the oldest version of Rover the spot was designed for. As of the writing of this reference, the current version number is 3.4.

The < head > tag

< head > … < /head >

These tags define a block of information which appears before the body section. The header acts as it does in HTML, containing information that applies to the entire spot.

The < body > tag

< body > … < /body >

These tags surround the body content of the spot description, including the map itself.


Intro | Head Tags | Body Tags