Re: Isurface, inverting the axis without changing default lighting direction [message #70816 is a reply to message #70724] |
Tue, 04 May 2010 18:06  |
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
|
|
|