7 | THE <CREATE> TAG: CREATING AND CHANGING TEXTURES
All of the 3DML blocks are assigned particular textures, and sometimes sounds or other attributes. With the <CREATE> tag, you can customize many of these features. The <CREATE> tag works by telling the browser to take a Block it already knows, change a few things about it, and give it a new ASCII symbol to represent the new Block in the map.
Each kind of Block that is used in a 3DML file has a number of "parts" that make up its shape. You can change the texture of each of these parts with the <CREATE> tag. For example, the FULL block has 6 parts corresponding to the six sides of the cube. They are refered to as "n, s, e, w, top, and bottom", with n,s,e, and w, corresponding to north, south, east, and west.
Lets take a look at a sample <CREATE> tag:
This tag tells the browser that we are going to make a new Block, which will be referred to in the map as the ASCII character "a", and which will be shaped like a FULL Block. Then we tell the browser to change the texture on the 4 sides of the cube to be the file "brick.gif", located in the "images" folder. Note that the "top" and "bottom" parts of the block haven't been changed, and will appear with the default texture.
Image File Formats.
<CREATE> tags are placed in the <BODY>, before your first Level.
If you want to change all of the parts of a block to be a single texture, you can use "*" to refer to all parts at once:
<PART NAME="*" TEXTURE="images/brick.gif" /> would change all parts of a block to the brick texture.
In the BLOCK attribute, you can refer to the Block type either by its name "FULL", or by its default ASCII symbol "#". You can also reuse the ASCII characters that are assigned as defaults. For example, if you aren't going to use any unaltered FULL blocks in your spot, then you can assign the "#" character to one of your changed Blocks:
Now everytime you use the "#" character in your map, you will get FULL Blocks that are textured with brick.gif, rather than the default texture.
All blocks have default textures that arrived when you originally downloaded the blockset. If you want to use one of these textures on a different part or different block, you can do so by preceeding the texture name with a "@"
This would put the texture clouds.gif, which usually appears as the default sky texture, on the top of the FULL block.
Color and Translucency
<PART NAME="name" COLOR="(red,green,blue)" />
You can also set a PART to be translucent:
<PART NAME="top" TEXTURE="painting.gif" TRANSLUCENCY="50%" />
The translucency feature will only show up to users who have 3D acceleration hardware installed. Users who don't will see all opaque textures.
The FACES parameter
The FACES parameter can also be used to make polygons invisible, by using FACES="0". This will prevent textures from being displayed on both sides of the polygon, making it invisible. You still won't be able to walk through it though.
The FACES parameter goes in the PART tag.
So the syntax for the entire PART tag is as follows:
<PART NAME="name" TEXTURE="folder/image.gif" COLOR="(r,g,b)" STYLE="tiled|stretched|scaled" PROJECTION="top|bottom|north|south|east|west" FACES="0|1|2" SOLID="yes|no" TRANSLUCENCY="number%" ANGLE="0-359"/>
The PLACEHOLDER texture
<PLACEHOLDER TEXTURE="image file path or URL" />
You can also use different colors as placeholders on specific blocks by using the COLOR attribute in the <CREATE> tag. If a <CREATE> tag has both a TEXTURE and COLOR attribute, then the color will be displayed as a placeholder until the image file arrives. This feature is useful if you want to try to approximate your final textures before they download. For instance, if one of your textures looks like water, then you could take a blue color from that texture and use it instead of the placeholder texture while the full texture downloads.
Or you can use the LOAD tag to force Rover to load textures in a different order. When Rover encounters a LOAD tag in a 3DML file, it will load that image at that time, before moving on to the next CREATE tag. The syntax for LOAD looks like this:
<LOAD TEXTURE="folder/image.gif" />
a texture in your spot
Save your file and open it in your browser. The
walls of your SPOT should now appear to be pink marble, and the ceiling
should be a sort of metal screen-like texture. If you go up onto the roof,
however, you will see that the top of the ceiling blocks haven't changed.
Copyright 1999, 2000 Flatland Online, Inc.