[PD] Creating a line in Gem

Olivier Baudu olivier at labomedia.net
Tue Dec 18 13:23:21 CET 2012

```Hi...

A [curve 2] will give you a perfect line.
With [cos ] and [sin ] you could "easyly" convert the angle in x, y for
the second point...

But, I'm not sure that using a rectangle, in your case, is neither so
difficult...
Before the rotation, you just have to translate the rectangle of the
half of the lenght it grows.
It's not a "trick" and works very precisely.

Cheers.

01ivier

Le 18.12.2012 12:46, Alexandros Drymonitis a écrit :
> Hi all,
> I've been trying to render a line in Gem, so I'm wondering if it's
> best to use [curve] (which is actually a curve as it indicates), or
> [rectangle] with a very small x value, so that it looks like a line.
>  My problem is that I want to give this line an angle, so I've been
> using [shearXY] for now. I also want to make the line grow from
> nothing to the full desired length, but with [rectangle] it will grow
> from the middle, so in order to make it grow from the starting point
> to the ending point, you have to give [rectangle] a continuous x,y
> offset.
>  This way it's really hard to determine the starting and ending point
> of the line. So, If for example the x,y coordinates of the starting
> and ending point are random, then the angle and length will also be
> random and you'll have to manipulate three different objects
> simultaneously ([rectangle], [translate] and [shearXY]), and I'm not
> sure if I can find the formula for all these calculations.
>  Is there an easier technique for this?
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list

--
"On ne peut pas vivre dans un monde où l'on croit que l'élégance
exquise du plumage de la pintade est inutile. Ceci est tout à fait à
part. J'ai eu envie de le dire, je l'ai dit." Jean Giono, Un roi sans
divertissement.

```