Re: Object graphics polygons [message #19841 is a reply to message #19762] |
Wed, 19 April 2000 00:00   |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
Steven Chetelat, chetelat@csee.usf.edu writes:
> My problem lies in figuring where to put them -- perhaps
> it is a matter of no training in the theater arts, but all
> my lights (positional, directional, and spotlights) only
> illuminate a small portion of my surface, even with
> intensities set very high. Do I need to modify the ambient
> lighting as well?
The following code works pretty well as a default setup and
simulates semi-directional daylight. It uses the RSI-provided routine
SET_VIEW, which sometimes puts the objects in slightly odd positions,
but they're always visible.
Assume that you have put your polygon in an IDLgrModel object
called theModel, and that you have already created an object graphics
window with an ID stored in a variable called mainWindow. Then do
this:
; make a seperate model for the lights, plus default lighting
lightModel = obj_new('IDLgrModel')
dirLight = obj_new('IDLgrLight', type=2, location=[1,1,1],
intensity=0.7)
ambLight = obj_new('IDLgrLight', type=0, intensity=0.4)
lightModel -> Add, dirLight
lightModel -> Add, ambLight
; make a view object and set a default viewplane rectangle
mainView = Obj_New('IDLgrView', color=[100,100,100])
mainView -> Add, lightModel
mainView -> Add, theModel
set_view, mainView, mainWindow, /do_aspect, /isotropic
If you rotate your model the lights will stay put, which is what
most users expect to happen. If you want to rotate the lights you can
either add them en-masse to your model, or turn them off and use other
lights of your own creation.
Struan
|
|
|