[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set_shading question

It's so nice having my news server working again, I can't help posting

"Paul van Delst" <paul.vandelst@noaa.gov> wrote in message
> Hey there,
> Can anyone enlighten me as to the LIGHT keyword to set_shading? The online
docs state:
> A three-element vector that specifies the direction of the light source.
The default light
> source vector is [0,0,1], with the light rays parallel to the Z axis.
> How does one change the direction of illumination? I want to change the
shading so I can
> specify a source point (say [1,0,1] in a unit cube) and a "destination"
point (say,
> [0,1,1]) to define the light source direction, i.e. where the light is
going *to*. Or is
> this stuff like wind direction, i.e. you specify where the light is coming

It does appear that way, that light is shining from the specified point in
your *viewing* frame of reference (nothing to do with the data coordinates)
toward the origin at the centre of the window. Try these illuminating

IDL> set_shading,light=[1,0,0]  & shade_surf,dist(50)
IDL> set_shading,light=[-1,0,0] & shade_surf,dist(50)
IDL> set_shading,light=[0,0,1]  & shade_surf,dist(50)
IDL> set_shading,light=[0,0,-1] & shade_surf,dist(50)


Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada