[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object rendering with dynamic views



Ben Tupper (pemaquidriver@tidewater.net) writes:

> I am wondering about the best way to manage objects graphics
> when the display consists of changing and unchanging
> models.  I have done it three different ways in the past,
> but I never considered the merits of each (until now.)

As anyone who has followed this newsgroup for any
length of time knows, I've gained almost all my
IDL expertise by doing things in the most godawful
possible way first, and then later--MUCH later, 
usually--figuring out a better way to do it.

My only redeeming quality is that I tend to perceive
failure as good information. :-)

(Well, except as it pertains to tennis, but that's
another story.)
 
> (1) The first way is that outlined in the online manual
> (also David has a nice page about this.)  This method
> involves just one view.   The view is first rendered with
> the static portion of the graphics exposed and the dynamic
> parts hidden using :
>  myDraw->DRAW, myView, /Create_Instance
> Then the view is made transparent, the static portion is
> hidden and the dynamic portion is exposed.  After that the
> view is drawn using:
>  myDraw->DRAW, myView, /Draw_Instance
> Any subsequent changes in the dynamic atoms/models are
> rendered using the DRAW_INSTANCE keyword.
> 
> (2) The second way is to create two overlapping views, the
> static underneath and the dynamic on top with the
> TRANSPARENT keyword set.   Then draw each view using the
> CREATE_INSTANCE and DRAW_INSTANCE keywords as needed.   This
> is a method discussed (a long time ago) on the newsgroup,
> but I can't find it documented anywhere.
> 
> (3) Put all the atoms/models in one view and render the
> whole thing as one.   Grind-grind-grind.   I use this method
> when in a hurry to write code, but I really don't want to
> look at it.

Alright, 99 percent of us do it the third way, too. But,
really, who needs it?

In fact, I don't have enough expertise to judge between
methods 1 and 2. I do it the first way. It works. End of
story for me. :-)

I do know that in object graphics there are ALWAYS several
ways to do something. Most of the time I understand one of
the methods, and I just scratch my head at the other. 
Which method do you think I use? I've never *noticed* that one
method is particularly better than another. Although
occasionally one method will be significantly *faster* than
another in real-world applications. I don't know if you
would find such a difference in methods 1 and 2 above,
but I doubt it.

I think, unfortunately, you just have to code it up and
try it. 
 
> Can someone explain the relative merits/pitfalls of each of
> the methods (in particular the first two?)  

I'm sure *someone* can. I'm just not that person. :-)
I do think, however, that if your static scene is
complicated to render, that creating an instance of it 
is almost guaranteed to be faster.

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155