Plotting lines between two polygons [message #12517] |
Wed, 12 August 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Hi Folks,
I'm tied up today with a project. Thought I would
post this and see if anyone else could help.
Cheers,
David
********************************************************
Date: Wed, 12 Aug 1998 16:53:25 +0200
From: Marco Konijnenburg <m.konijnenburg@amolf.nl>
Organization: FOM-institute AMOLFMIME-Version: 1.0
To: David Fanning <davidf@dfanning.com>
Subject: Plotting lines between two polygons
Hello Mr. Fanning,
I tried to post the following message to the
"comp.lang.idl-pvwave" newsgroup, but it didn't work. I
was hoping that you would know the answer or else would
you post this question for me?
I would like to plot lines between polygons using
object graphics.
When creating the polygons there is no trouble. The
coordinates used
to define the polygons (circles) can be used to define
the lines.
One of the circles has to be rotated/translated
interactively. This circle has it's own IDLgrModel as
conatiner. This container and the polygon that is
static are together with the lines in another
container.
Can anybody tell me how to retrieve/compute the new
coordinates for the line after a rotation/translation
of the polygon?
Thanks.
Marco
------------------------------------------------------------ -----------
ing. Marco Konijnenburg FOM
institute AMOLF
E&I
Department / DUBBLE CRG
Tel: (+31) 020 6081234 Kruislaan
407
Fax: (+31) 020 6684106 1098 SJ
Amsterdam
mailto:m.konijnenburg@amolf.nl The
Netherlands
------------------------------------------------------------ -----------
--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Plotting lines between two polygons [message #12612 is a reply to message #12517] |
Mon, 24 August 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
<snip>
>
> Can anybody tell me how to retrieve/compute the new
> coordinates for the line after a rotation/translation
> of the polygon?
>
Marco:
I'm not sure exactly what you're after, but here is a general
method for computing the new coordinates for the lines after
rotation and translation, for R2:
xcoors = [x1,x2,x3,...,xN] ; Vector of X coordinates for vertices
ycoors = [y1,y2,y3,...,yN] ; Vector of Y coordinates
p = fltarr(N,4)
p[*,0] = xcoors[*]
p[*,1] = ycoors[*]
p[*,3] = 1.0
save_pt = !p.t ; Compute matrix for affine transformations
t3d, /reset
t3d, rotate = [0.0, yrot, 0.0] ; Apply rotations
t3d, rotate = [xrot, 0.0, 0.0]
t3d, translate = [dx, dy, 0.0] ; Apply translation
t3d, scale = [scalex, scaley, 1.0] ; Apply scaling
p_new = p[*,*] # !p.t[*,*] ; Compute new coordinates
!p.t = save_pt
Hope this helps.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|