FLATLAND TUTORIAL
|
11
| LIGHTING
We have already discussed the <AMBIENT_LIGHT> tag, which goes in the <HEAD> section of the 3DML file. Ambient_light lights everything in your SPOT evenly, without creating any shadows. If you are going to be using lighting effects in your SPOT, then you should set your ambient_light relatively low (around 50% or less), so that your other lights will show up more dramatically. Aside from AMBIENT_LIGHT, there are three different categories of light: ORB light, POINT_LIGHT, and SPOT_LIGHT. ORB light is light that shines from a specific direction in the sky, illuminating the entire SPOT. POINT_LIGHT is light that shines in all directions from a specified location. SPOT_LIGHT is light that shines in a specified direction from a specified location.
The ORB tag No matter what texture you use in the sky, light will shine from the location of the texture illuminating the entire SPOT. Unlike AMBIENT_LIGHT, light from the ORB will create shadowed areas. Ambient light will illuminate all areas of a SPOT, regardless of whether or not they are exposed to the sky. But ORB light will only illuminate surfaces that face the light source. POSITION refers to where the orb will sit in the sky. POSITION is expressed as a pair of angles called "turn" and "tilt". The turn angle specifies what direction the orb will be in. Possible values are from 0-359, with 0 refering to north, 90 to east, 180 to south, etc. The tilt angle defines how high in the sky the orb will appear. Possible values range from -90 to 90, with 0 being at the ground, or "horizon", 90 being directly overhead, etc. BRIGHTNESS defines how bright the orb light will be. And TEXTURE defines what image will be displayed. BRIGHTNESS will be 100% by default, and the default ORB texture will be displayed in the sky if no other TEXTURE is specified. COLOR allows you to define the color of the light, but colored light will only appear to users who have 3D acceleration hardware. Other users will see the normal white light. You can also turn your ORB into a hyperlink by adding an HREF parameter: <ORB TEXTURE="folder/image.gif" POSITION="(turn,tilt)" BRIGHTNESS="percentage%" COLOR="(red,green,blue)" HREF="url" TEXT="text" TARGET="target_frame"/> Add
ORB light to your SPOT. <AMBIENT_LIGHT BRIGHTNESS="30%" /> Then place the following tag in the HEAD section of tallspot.3dml: <ORB POSITION="(45,45)" BRIGHTNESS="60%"/> POINT_LIGHT
<POINT_LIGHT STYLE="static" POSITION="(x, y, z)" BRIGHTNESS="n%" RADIUS = "#_of_blocks" FLOOD="yes|no" COLOR="(red,green,blue)"/> Here, POSITION refers to the placement of the light within the block space. POSTION="(0,0,0)" would place the light at the bottom southwest corner of the block. POSTITION="(128,256,128)" would place the light in the middle of the top of the block. Lights will be placed in the center of the block (128,128,128) by default if no POSITION is defined. BRIGHTNESS defines how bright the light will be at the position of the source. RADIUS defines how far from the source the light will be visible. If RADIUS="4" and BRIGHTNESS="90%", then the light will be 90% brightness at the location of the light source, and will fade gradually to whatever the ambient_light level is 4 blocks away. That is, unless FLOOD is set to "yes". FLOOD="yes" will cause the light to flood the entire radius at the specified brightness level. In the above example, if FLOOD were turned on, then light would appear at 90% brightness for the entire 4 block radius, and the light would drop sharply to the ambient level at the edge of the 4 block radius. The FLOOD parameter defaults to "no". COLOR allows you to define the color of the light, but colored light will only appear to users who have 3D acceleration hardware. Other users will see the normal white light. Note that every polygon inside of a light's radius will not necessarily be illuminated. Only those polygons that face the light will be lit. A polygon that is within the radius of a light, but is not facing it, will not be affected by the light.. Pulsating POINT_LIGHT
<POINT_LIGHT STYLE="pulsate" POSITION="(x, y, z)" BRIGHTNESS="min%..max%" RADIUS = "#_of_blocks" FLOOD="yes|no" COLOR="(red,green,blue)" SPEED="cycles_per_second" /> Notice that the BRIGHTNESS parameter describes a range between two values. And there is an added SPEED parameter. If BRIGHTNESS="20%..80%" and SPEED="2", then the light level will pulse from 20% to 80% and back again twice every second. You can slow the pulse down by assigning a value less than 1 to the SPEED parameter. SPEED=".25" would create a light that takes four seconds to raise to its brightest level and back again. Turn
Smileys into Alien Abductors <POINT_LIGHT STYLE="pulsate" POSITION="(128,0,128)"
So the entire <CREATE> tag for the "c" block will look like this: <CREATE SYMBOL="c" BLOCK="ceiling">
This will make a pulsating light UNDER all of your smileys. Remember, your smileys are ceiling blocks with smiley faces on the top of the block space. This POINT_LIGHT is assigned to the bottom of the block space. Your smiley textures will not be lit by it because they face away from it. In order to light the smiley textures themselves, you would want to place a light above the smiley blocks, in level 3 of your map.
SPOT_LIGHT
The tag for a static SPOT_LIGHT looks like this: <SPOT_LIGHT STYLE="static" POSITION="(x, y, z)" BRIGHTNESS="n%" RADIUS="#_of_blocks" FLOOD="yes|no" COLOR="(red,green,blue)" DIRECTION="(turn, tilt)" CONE=angle"/> POSITION, BRIGHTNESS, RADIUS, FLOOD, and COLOR all work the same here as they do for POINT_LIGHTs. DIRECTION describes where the SPOT_LIGHT is focused, and is expressed as a pair of angles. If no DIRECTION parameter is present, the light will face exactly north and horizontal to the ground plane by default, [or DIRECTION="(0,0)"]. The first angle is called the "turn". The turn angle describes rotation in the horizontal plane. Possible values range from 0 to 359, where 0 is north, 180 is south, etc. The second angle is called the "tilt" and describes how far above or below the horizontal plane the light points. Possible values range from -90 to 90, where 0 is horizontal to the ground, 90 points straight up, and -90 points straight down. With the turn and tilt angles, you can describe any possible direction for your light to point. CONE describes how wide the SPOT_LIGHT is. CONE is the diameter of the influence of the light, expressed as a degree, (0 to 359). The default value for CONE is 45. So a SPOT_LIGHT with DIRECTION="(45,0)" and CONE="90" would illuminate the northeastern corner of a scene (assuming that the SPOT_LIGHT is in the center of the scene.) The turn angle is 45 pointing directly northeast, the tilt angle is 0 pointing parallel to the ground plane, and the CONE is 90 which spreads the light out over a 90 degree area from the north axis to the east axis. DIRECTION="(0,-90)" would create a light that points straight down. Searching SPOT_LIGHT
<SPOT_LIGHT STYLE="search" POSITION="(x, y, z)" BRIGHTNESS="n%" RADIUS="blocks" FLOOD="yes|no" COLOR="(red,green,blue)" DIRECTION="(turn1,tilt1)..(turn2,tilt2)" CONE = "angle" SPEED="cycles_per_second" /> In a search style spot_light, you can define 2 different DIRECTIONs and the search light will move smoothly back and forth between the two DIRECTIONs. The path that the search light takes between the 2 defined DIRECTIONs is determined by which DIRECTION has a higher value for its turn angle. (This may get a little complicated, so hold on tight.) The light will always travel from the lowest turn angle value to the highest. Values for the turn angles can range from -359 to 359. To make a search light that moves between a point directly north to a point directly east, you would designate DIRECTION="(0,0)..(90,0)", and the light would travel clockwise from the north horizon to the east horizon. But what if you wanted a light to travel between the same 2 points, but to go the long way around, passing by the south and west horizons on the way? Then you would change the value of the eastern direction to read (-270,0). DIRECTION="(0,0)..(-270,0)" would create a light that travels clockwise from the eastern horizon to the northern horizon and back again, passing through the south and west on the way. SPEED determines how fast the search light will move between the 2 DIRECTIONs. SPEED is expressed as cycles per second. SPEED="2" would make a light that moves from DIRECTION 1 to DIRECTION 2 and back again twice per second. Revolving SPOT_LIGHTs.
<SPOT_LIGHT STYLE="revolve" POSITION="(x, y, z)" BRIGHTNESS="n%" RADIUS="blocks" FLOOD="yes|no" COLOR="(red,green,blue)" DIRECTION="(turn1,tilt1)..(turn2, tilt2)" CONE="angle" SPEED="revolutions_per_second"/> This tag is very similar to the syntax for the search light, but the light will continue in a full circle through the 2 specified directions. If the turn angle of the first DIRECTION is smaller than the second one, then the light will rotate in a clockwise direction. If the second turn angle is smaller, then the motion will be counterclockwise. Placing Lights
in Your SPOT 1. Adding lights to blocks using the <CREATE> tag 2. Assigning lights to particular locations in the map. 3. Using LIGHT Blocks The tags that describe POINT_LIGHTs and SPOT_LIGHTs can be placed in the <CREATE> tag of any block. Remember that a light included in a <CREATE> tag will appear in every instance of that block in the map. Note that a block can only have one light assigned to it. Alternately, a light can be assigned to a specific location in your map, regardless of what block might be there. To do this, simply put your light tag in the body of your 3DML file (usually near the end with your entrances and exits). You will also need to add a LOCATION parameter to the light tag to place the light at a specific location in the map. The LOCATION parameter works just the way it did for sounds: LOCATION="(column, row, level)" Add
a Search Light.
<SPOT_LIGHT STYLE="search" POSITION="(1,1,128)"
This should give you a SPOT_LIGHT that searches back and forth between the two portals on level 1 of tallspot.3dml New Blocks
Add
a LIGHT Block <LEVEL NUMBER="2"> This should give you a bright light over the ramp area.
|
Copyright 1999, 2000 Flatland
Online, Inc.