![]() |
|
|
Example To make a new light: do the following. It is important to make sure that the light you would like to create does not already exist. You will crash if it does. The following is a point light: Which is just a light at any given point in 3space. if ( keystate(2) and
onLight1 = 0 and shiftkey
() = 0 ) endif This will create a light at the position 0, 10, 0. This is optional since the set point light function will position this for you. As for the color, it can also be set with an RGB value, to insert one, right click and goto color picker in the compiler, or type rgb(rrr,ggg,bbb) in values from 0 to 255. A Flashlight: in this example, the light is made with an innercone of 1 degree ( bright light ) and an outer cone of 10 degrees. This at the moment will point straight down. if ( keystate(5) and onLight4
= 0 and shiftkey< /FONT >
() = 0)
Now to make the light point in the direction you are looking, you must adjust it so it points to the same place as your player is looking. Sunlight: In this example we create light that appears to come from an extremely far off distance. if ( keystate(6) and onLight5
= 0 and shiftkey () =
0)
make light 5 endif This will make a light the GOES in the direction of 0, 10, 0, which would be from straight down to straigt up. Rotating and Moving Lights: Most useful with the spotlight. if ( light exist (4) )
position light 4, posX#, posY#, posZ#endif To add a fog to the whole atmosphere is simple. if ( keyState(33)
and fogOn = 0 and shiftkey()
= 0)
fog onendif To Set the distance the fog will block, simply: if ( keyState(12)
and fogOn = 1 )
fogDist = fogdist + 350 * theTime.avgCycleTime#endif And finally, to color it, just: if ( keystate(11)
and fogOn = 1)
fog color rnd( 255), rnd( 255), rnd (255)endif
|
|
|
|
|