|
|
Re: Question About Scatter Surface Pro (Final explanation!!) [message #48773 is a reply to message #48772] |
Thu, 18 May 2006 09:57  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
What a day! I need more coffee. Here is what I had written
previously:
> I have learned in discussions this morning that I can avoid
> this problem if I *don't* use the [XYZ]COORD_CONV keywords with
> the orbs, but simply position them with the DATA keyword *while*
> scaling and translating them. Huh!?
>
> Here is the corrected code:
>
> FOR j=0,npts-1 DO BEGIN
> (line[j])-> SetProperty, XCoord_Conv=xs, $
> YCoord_Conv=ys, ZCoord_Conv=zs
> (line[j])->GetProperty, Data = Data
> orbs[j]->SetProperty, Pos = [data[0, 1]*xs[1] + xs[0], $
> data[1, 1]*ys[1] + ys[0], data[2, 1]*zs[1] + zs[0]]
> ENDFOR
When I realized I had botched the explanation (I didn't use
the DATA keyword, I used a POS keyword with the data!) I wanted
to correct things. I assumed the POS keyword was a POSITION
keyword that had been shortened in the code sent to me by
my collaborator. Since I *hate* shortened keywords in
pedagogical code (one of my pet peeves with the company
formerly known as RSI), I changed it to POSITION in my
example program. Then ran my example program (as I *always*
do before I download a program to my web page) and the
program didn't work anymore!
Yikes!! I was VERY confused for a couple of minutes because
the program ran without errors, but produced results that
were different than the program of two minutes ago. (Those
of you who are more familiar with computers, and especially
Macintosh computers, will wonder what all the fuss is about,
but still...)
Anyway, the long and short of this is that the POS keyword
*does* stand for "position", but you can't *use* the POSITION
keyword, because that is used for something else (I don't know
what this might be, but presumably it is a keyword for a
superclass object.) The POS keyword is defined from the Orb
object (how or why it even works is another mystery for today!!)
and it is what should be used in the code.
Whew! There. Problems all solved. Ya gotta love object graphics! :-)
Cheers,
David
all the fuss is about
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|