comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: set_shading question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: set_shading question [message #25645] Thu, 05 July 2001 11:58
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Dick Jackson wrote:
>
> It's so nice having my news server working again, I can't help posting
> again...
>
> "Paul van Delst" <paul.vandelst@noaa.gov> wrote in message
> news:3B44A99F.5D58EC6@noaa.gov...
>> Hey there,
>>
>> Can anyone enlighten me as to the LIGHT keyword to set_shading? The online
> docs state:
>>
>> LIGHT
>> 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
> *from*?
>
> 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
> examples:
>
> 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)

Ahh, I see (I think). The light source shines FROM [x,y,z] to [0,0,0] where the latter is
the centre of the window. +/-x is right/left side of window, +/-y is top/bottom of window,
+/-z is above/below window (relative to monitor screen).

I don't do a lot of volume rendering/shading so maybe to the experienced out there this
seems quite normal, but to poor old shading neophyte me, it seems quite ridiculous -
mostly because it's not pointed out in the docs. Argh.

Thanks very much for the clarification Dick. I'm glad your news server is working again!

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: set_shading question [message #25648 is a reply to message #25645] Thu, 05 July 2001 11:19 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
It's so nice having my news server working again, I can't help posting
again...

"Paul van Delst" <paul.vandelst@noaa.gov> wrote in message
news:3B44A99F.5D58EC6@noaa.gov...
> Hey there,
>
> Can anyone enlighten me as to the LIGHT keyword to set_shading? The online
docs state:
>
> LIGHT
> 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
*from*?

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
examples:

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)

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Sound with IDL... HELP!
Next Topic: using USERSYM

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:38:19 PDT 2025

Total time taken to generate the page: 0.00480 seconds