Light objects [message #51594] |
Mon, 04 December 2006 10:13  |
eric :)
Messages: 3 Registered: November 2006
|
Junior Member |
|
|
Hi all,
In object graphics, how can I keep a light source added to one model
from interfering with (or, shining on) objects in another model? The 2
models are in the same view.
Thanks,
Eric
|
|
|
Re: Light objects [message #51737 is a reply to message #51594] |
Mon, 04 December 2006 11:10  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Interesting question. I've always wanted the light to shine on
everything...
You can control this by creating two separate views. Create identical
views, one for each lighting scenario, and set the transparent keyword
on one. Add your objects accordingly and place them in a viewgroup to
display.
Remember to order your views in your viewgroup such that the opaque view
is first (farthest away) followed by the transparent one(s).
o1 = obj_new('orb', COLOR=[100,200,255], POS=[-2,0,0])
o2 = obj_new('orb', COLOR=[255,200,100], POS=[2,0,0])
l1 = OBJ_NEW('IDLgrLight', TYPE=1, INTENSITY=1.0)
view1 = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[-3,-3,6,6])
view2 = OBJ_NEW('IDLgrView', VIEWPLANE_RECT=[-3,-3,6,6], $
/TRANSPARENT)
viewgroup = OBJ_NEW('IDLgrViewgroup')
m1 = OBJ_NEW('IDLgrModel')
m2 = OBJ_NEW('IDLgrModel')
m2->Add, [o2]
m1->Add, [o1,l1]
view1->Add, m1
view2->Add, m2
viewgroup->Add, [view1,view2]
window=OBJ_NEW('idlgrwindow')
window->Draw, viewgroup
-Rick
eric :) wrote:
> Hi all,
>
> In object graphics, how can I keep a light source added to one model
> from interfering with (or, shining on) objects in another model? The 2
> models are in the same view.
>
> Thanks,
> Eric
>
|
|
|