divergingLights.lsc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Script to test the effect of diverging coloured lights
# Creates multiple objects with increasing divergence between cold and warm light.
# --------------------------------------------------------------------------------

baseDir = "c:\research\reliefPaper\data\";
object = open(baseDir&"MtRainier.srf");

# Set phong shading parameters
edit(object,"specular",70);
edit(object,"diffuse",50);

# Sun shining between W and NW (midway between spurs of Imhof snowflake).
sunAzim = 292.5;
sunDeviation = 0;
maxDeviation = 45;

while(sunDeviation <= maxDeviation);
{
    echo("Creating relief maps with deviation of "&sunDeviation&" degrees.");

    # Cold light clockwise of main sun azimuth
    edit(object,"sunAzim",(sunAzim+sunDeviation)%360);
    relief1 = surfparam(object,"shade",3,1);
    colouredit(relief1,"rules","0 0 0 0, 1 127 127 255");

    # Warm light anticlockwise of main sun azimuth
    edit(object,"sunAzim",(sunAzim-sunDeviation)%360);
    relief2 = surfparam(object,"shade",3,1);
    colouredit(relief2,"rules","0 0 0 0, 1 255 255 127");
 
    # Blend the warm and cold images
    fileName = baseDir&"divergingLights/rainierDev"&sunDeviation&".png";
    draw(fileName,relief1,relief2,"null","blend",50);

    sunDeviation = sunDeviation + 5;
}