texture styles orientation guide tips,tricks more blocks actions sprites popups lighting sound linking orientation textures navigation mulitilevels body tag head tag starting welcome

The <HEAD> tag contains several tags that apply to the entire 3DML file.

The <DEBUG> tag
<DEBUG> is an optional tag you can use to get more information about errors in your 3DML file. Rover is designed to ignore errors in 3DML files as much as possible. It will go ahead and display a spot as best it can when errors are present in the file. But if you include the <DEBUG> tag, Rover will display error messages that will help you to locate and correct those errors. You will want to put the DEBUG tag at the very beginning of the HEAD section of your 3DML file, so that it will catch any errors in the HEAD section as well. The best use of the debug tag is to include it while you are working on your 3DML files, and then to erase it before publishing your spot to the Web.

Add a debug tag.
Add the following line of code just after your <HEAD> tag:


The <TITLE> tag
The <TITLE> tag holds the title of the spot. The title text will be displayed at the bottom of the browser window.

<TITLE NAME="title text" />

Add a title to your spot
Put the following code between the <HEAD> tags in your 3DML file:

<TITLE NAME="First Spot" />

The <BLOCKSET> tag
The <BLOCKSET> tag lets Rover know what set of blocks and default textures to use to display the SPOT. The BLOCKSET is expressed as a URL. The first time a user encounters a new BLOCKSET, Rover will ask for confirmation before downloading it. Assuming the user agrees, the new BLOCKSET is downloaded and placed in the Flatland cache on the user's hard drive, where it will remain indefinitely. The next time the user encounters the same blockset, Rover will check the cache first before attempting to download the new set.

Everything in a 3DML spot is made out of blocks. The <BLOCKSET> tag tells the browser what set of blocks to use to display the SPOT. Currently, there are two sets available: the basic set (contaning mostly simple block-like shapes) and the village set (containing houses, sidewalks, trees, etc.).

Specify a BLOCKSET
Put the following code between the <HEAD> tags in your .3DML file:

<BLOCKSET HREF="http://blocksets.flatland.com/flatsets/basic.bset"/>

The <MAP> tag
<MAP STYLE="single|double" DIMENSIONS="(columns,rows,levels)" />

The <MAP> tag has two attributes: DIMENSIONS and STYLE. DIMENSIONS tells the browser what size your spot is going to be. Spots are measured in blocks, (columns, rows, levels). When you are building spots, remember that whenever you change the dimensions of your spot by adding new levels or columns, you will have to change the dimensions in the <MAP> tag as well. Or else your browser will call you nasty names. We will discuss the STYLE attribute later on in the MORE BLOCKS! section of the tutorial. For now, just use STYLE="single".

Provide dimensions for your spot.
We are going to make a spot that is 9 blocks wide, 9 blocks long, and 1 block high. Put the following code between the <HEAD> tags in your .3DML file.

<MAP STYLE="single" DIMENSIONS="(9,9,1)" />

The <SKY> tag
<SKY TEXTURE="image-file-path-or-URL" COLOR="(red,green,blue)" BRIGHTNESS="brightness%"/>
The <SKY> tag sets an image to be used as the background for your spot. This texture will appear anywhere there aren't any blocks visible. If you don't put a ceiling on your spot, the texture defined in the <SKY> tag will appear in the sky. Also, if you leave any holes in your walls or floors, then the <SKY> texture will be seen there as well.

If you prefer, you can set a color to show up in the Sky, rather than a texture. The color is expressed by red, green, and blue values of 0-255. For example, pure red would be expressed as COLOR="(255,0,0)", pure blue is COLOR="(0,0,255)", and pure green would be COLOR="(0,255,0)". All other colors can be expressed as combinations of red green and blue. To find the RGB value for any color, you can use this nifty RGB Color Picker. It's a small download (145k), and a very useful little program. Download the file to your hard drive, and double click it to install.

You can also set the brightness of the Sky texture in the <SKY> tag. Brightness is expressed as a whole number percentage. If you don't specify a brightness setting, the default level is 100%. If you leave out the <SKY> tag altogether, the background will default to the Sky texture that is specified in the Blockset. For the Basic blockset, that texture is a partly cloudy blue sky.

Remember, if your image file isn't in the same folder as your .3DML file, then you also need to specify the path to your image: <SKY TEXTURE = "folder/image.gif" />

Define a sky texture for your spot:
Put the following code between the <HEAD> tags in your .3DML file. The image "clouds.gif" should be in a folder called "images", which is in the same folder as your .3DML file.

<SKY TEXTURE = "images/clouds.gif" BRIGHTNESS = "90%" />

The <GROUND> tag
<GROUND TEXTURE="image-file-path-or-URL" COLOR="(red,green,blue)" />
The <GROUND> tag specifies a texture (or color) to be used on the ground plane of your spot. If you use the <GROUND> tag, then you won't have to supply a solid floor of blocks in your map. The ground will be the same dimensions as your map. If your map is 5 blocks by 8 blocks, then your ground will be that same size as well.

You can specify either a TEXTURE or a COLOR with which to fill the ground plane. If you leave the <GROUND> tag out, there will be no ground plane displayed in your spot, and you will have to supply a solid floor made of blocks in order to keep your visitors from falling endlessly through virtual space, (much like Oblio and Arrow when they fell down the well in The Point.) If you want to use the default ground texture specified by the Basic Blockset, then simply include an empty <GROUND> tag in your 3DML file: <GROUND /> This will give you a generally dirt colored floor.

Define a ground for your spot
Put the following line of code between the <HEAD> tags in your .3DML file:

<GROUND TEXTURE="images/dirt.gif" />

<AMBIENT_LIGHT BRIGHTNESS="brightness%" COLOR="(red,green,blue)"/>
The <AMBIENT_LIGHT> tag has two attributes: BRIGHTNESS and COLOR. BRIGHTNESS defines how bright your spot will appear to be in areas where you haven't placed any other lights. BRIGHTNESS is expressed as a whole number percentage. If you set your ambient light relatively low, say around 50%, then you will have more room to play with lighting effects later. If you don't need that kind of flexibility, go ahead and set BRIGHTNESS at or close to 100%. The COLOR attribute allows you to specify what color the light is in your spot, although colored light will only appear when Rover is being run on 3D acceleration hardware.

BRIGHTNESS defaults to 100%, if not otherwise specified. COLOR defaults to white, or (255,255,255). We will go over lighting in more detail in the Lighting section of the tutorial. For now, let's leave your ambient light at the default levels.

Let there be light.
Put the following code between the <HEAD> tags in your .3DML file:


<AMBIENT_SOUND FILE="wave-file-path-or-URL" VOLUME="volume%" PLAYBACK="looped|random" DELAY="minimum..maximum" />
The <AMBIENT_SOUND> tag specifies a sound file that will play throughout your SPOT. The ambient sound will be heard at the same volume throughout the entire spot. The sound can either be looped continuously or played at random intervals with the PLAYBACK attribute. If PLAYBACK="random", you can also specify a range of DELAY times between playbacks. DELAY times are measured in seconds, and are measured from the time that the sound begins,rather than when it ends. For example, if your sound is 5 seconds long, PLAYBACK="random", and DELAY="5..10", then sometimes the sound will play back to back, (as the length of the sound file is the same as the minimum delay time), and no more than 5 seconds will ever elapse between when the sound ends and when it begins again. (The maximum DELAY time, 10 seconds, minus the length of the sound itself, 5 seconds, leaves a maximum silence of 5 seconds.) The default values for these attributes are as follows: VOLUME="100%" PLAYBACK="looped" DELAY="5..10"

We'll talk about other ways to use sound later in the Sound section of the tutorial.

Set an Ambient Sound file
Put the following code between the <HEAD> tags in your .3DML file:

<AMBIENT_SOUND FILE="sounds/waves.wav" VOLUME="65%" PLAYBACK="looped"/>

After you've heard how this works, you may want to remove the AMBIENT_SOUND tag from your file, or you are likely to get very tired of hearing it throughout this tutorial!

Other <HEAD> Tags
There are two other tags that can go in the HEAD section of the 3DML file: PLACEHOLDER and ORB. We'll discuss these tags later on in the tutorial.

see code next lesson


Copyright 1999, 2000 Flatland Online, Inc.