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

Home » Public Forums » archive » Re: Isurface, inverting the axis without changing default lighting direction
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: Isurface, inverting the axis without changing default lighting direction [message #70724] Tue, 04 May 2010 06:58 Go to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<0b7ca13f-9430-4824-ac14-6d0b1186722d@40g2000pry.googlegroups.com>,
cameron bowles <cameronbowles79@gmail.com> wrote:

> Hi everyone, long time reader first time poster.
>
> I have run into this problem where I want to plot a surface using the
> iSurface functionality of IDL 7.0. I want the Y-axis to be inverted
> (ie. showing the maximum value at the common axes point. I can simply
> do this with Yrange = [max[Y], min[Y]], but when I do this the
> lighting vector for the surface flips around the Y=0 plane and the
> surface is highlighted from some strange angle that doesnt highlight
> the surface at all.

One solution is to modify the properties of the lighting. To get started
interactively, double click in the background of the plot. This
should open the Visualization Browser, which will show you the
object hierarchy. By default you should find an ambient and a
directional light. Click on each to adjust its properties.
Changing the Distance property of the directional light to
negative moves it "above" the surface to give natural looking light.

Once you have things the way you want, you can do then do it
programmatically using something like this

lights_id = itool_obj -> FindIdentifiers('*LIGHTS', /VISUALIZATIONS) ;Get lights ID
lights_obj = itool_obj -> GetByIdentifier(lights_id) ;Get lights object reference
lights_obj -> SetProperty, INTENSITY = 0.7 ;Set lighting intensity
itool_obj -> RefreshCurrentWindow ;Refresh window

It would be nice, however, if there was an easy way to reverse
the direction of the surface normals so that this was not necessary.
That might be possible, but I don't know how to do it.

Ken Bowman
Re: Isurface, inverting the axis without changing default lighting direction [message #70788 is a reply to message #70724] Wed, 05 May 2010 11:24 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<f460e955-39e9-40d4-be31-0beb89b53ef7@u20g2000pru.googlegroups.com>,
cameron bowles <cameronbowles79@gmail.com> wrote:

> For anyone reading this, I ended up just defininn my "lights_id"
> idebntifier to be that of Light_1 using this line of code in place of
> the code in my second post;
>
> lights_id = itool_obj -> FindIdentifiers('*LIGHT_1', /VISUALIZATIONS)
>
> it now works a treat and looks good to boot.
>
> Thanks again Ken and PP.

I just want to make clear that this does not mean that I
actually understand anything about how the iTools work. ;-)

K
Re: Isurface, inverting the axis without changing default lighting direction [message #70816 is a reply to message #70724] Tue, 04 May 2010 18:06 Go to previous message
cameron bowles is currently offline  cameron bowles
Messages: 5
Registered: May 2010
Junior Member
On May 4, 10:58 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < 0b7ca13f-9430-4824-ac14-6d0b11867...@40g2000pry.googlegroups .com >,
>  cameron bowles <cameronbowle...@gmail.com> wrote:
>
>> Hi everyone, long time reader first time poster.
>
>> I have run into this problem where I want to plot a surface using the
>> iSurface functionality of IDL 7.0. I want the Y-axis to be inverted
>> (ie. showing the maximum value at the common axes point. I can simply
>> do this with Yrange = [max[Y], min[Y]], but when I do this the
>> lighting vector for the surface flips around the Y=0 plane and the
>> surface is highlighted from some strange angle that doesnt highlight
>> the surface at all.
>
> One solution is to modify the properties of the lighting.  To get started
> interactively, double click in the background of the plot.  This
> should open the Visualization Browser, which will show you the
> object hierarchy.  By default you should find an ambient and a
> directional light.  Click on each to adjust its properties.
> Changing the Distance property of the directional light to
> negative moves it "above" the surface to give natural looking light.
>
> Once you have things the way you want, you can do then do it
> programmatically using something like this
>
> lights_id  = itool_obj -> FindIdentifiers('*LIGHTS', /VISUALIZATIONS)   ;Get lights ID
> lights_obj = itool_obj -> GetByIdentifier(lights_id)                    ;Get lights object reference
> lights_obj -> SetProperty, INTENSITY   = 0.7                            ;Set lighting intensity
> itool_obj  -> RefreshCurrentWindow                                      ;Refresh window
>
> It would be nice, however, if there was an easy way to reverse
> the direction of the surface normals so that this was not necessary.
> That might be possible, but I don't know how to do it.
>
> Ken Bowman

Thankyou so much for your tips Ken, they really helped. In the end I
got it to look kind of OK with this code;

void = ITGETCURRENT(TOOL=itool_obj)
lights_id = itool_obj -> FindIdentifiers('*LIGHTS', /
VISUALIZATIONS) ;Get lights ID
lights_obj = itool_obj ->
GetByIdentifier(lights_id) ;Get lights object
reference
lights_obj -> SetProperty, INTENSITY = 0.7, DISTANCE =
-20 ;Set intensity and distance (z axis)
itool_obj -> RefreshCurrentWindow

However I would really like to be able to set the location and
direction of the directional light, this should be possible with;

lights_obj -> SetProperty, DIRECTION = [x,y,z], DISTANCE = [x,y,z]

But I found that no matter what setting I had for x/y/z it wouldnt
affect the lighting. Has anyone done this manually? I roughly want to
have the light coming with a vector of [1,1,-1] from a position
direction of [-1,-1,1]. If anyone knows the tricks to get that working
I would appreciate it.

Thanks again for your help Kan, it is now in a semi working state :)
Cam
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Fourier Fitting Data in PV-Wave
Next Topic: Isurface, inverting the axis without changing default lighting direction

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

Current Time: Wed Oct 08 11:44:47 PDT 2025

Total time taken to generate the page: 0.00632 seconds