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

Home » Public Forums » archive » Isurface, inverting the axis without changing default lighting direction
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Isurface, inverting the axis without changing default lighting direction [message #70815 is a reply to message #70727] Tue, 04 May 2010 18:49 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On May 4, 10:06 pm, cameron bowles <cameronbowle...@gmail.com> wrote:
> 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.

I think your problem is the object you are picking to edit. By
default, isurface makes two lights, one ambient (isotropic, I guess),
and one directional. For instance,

IDL> ids=itool_obj->findidentifiers('*LIGHT*',/visualization)
IDL> for i=0,n_elements(ids)-1 do print,ids[i]
/TOOLS/SURFACE TOOL/WINDOW/VIEW_1/VISUALIZATION LAYER/LIGHTS
/TOOLS/SURFACE TOOL/WINDOW/VIEW_1/VISUALIZATION LAYER/LIGHTS/LIGHT
/TOOLS/SURFACE TOOL/WINDOW/VIEW_1/VISUALIZATION LAYER/LIGHTS/LIGHT_1

You are selecting the lights object, but the properties you want to
edit are for the directional object, which in this case is LIGHT_1:

IDL> light=itool_obj->getbyidentifier('/TOOLS/SURFACE TOOL/WINDOW/
VIEW_1/VISUALIZATION LAYER/LIGHTS/LIGHT')
IDL> light->getproperty,name=name & print,name
Ambient Light
IDL> light=itool_obj->getbyidentifier('/TOOLS/SURFACE TOOL/WINDOW/
VIEW_1/VISUALIZATION LAYER/LIGHTS/LIGHT_1')
IDL> light->getproperty,name=name & print,name
Directional Light

With the object for the directional light, I can move and point it
around with

light->setproperty,location=[1,1,-1],direction=[-1,-1,1]

Note that it may take a

itool_obj->commitactions

for the image to be updated after you change the objects.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Isurface, inverting the axis without changing default lighting direction
Next Topic: Re: Help needed in remapping data using IDL

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

Current Time: Wed Oct 08 13:45:48 PDT 2025

Total time taken to generate the page: 0.00828 seconds