Re: Draw a scaled arrow
- From: RichT <someone@xxxxxxxxxxxxx>
- Date: Mon, 19 May 2008 19:48:50 +0100
The trick is to move the origin to the root of the arrow with a
transform before you apply the scale.
see http://mindprod.com/jgloss/affinetransform.html
Thanks this is very helpful.
It is at this point I wish I had paid attention in Math class instead of
sketching the next killer game in the back of my work book :(
There are two parts of the arrow, the line and the head, the line is fairly easy multiply the x1,y1 and x2,y2 coordinates by the scale and do the same for thickness of brush.
the head is made up of 3 pairs of x,y coords, my first idea was to move the centre point to the new line end of the scaled arrow, and then apply the scale factor to the remaining coords, this did not work too well because the head can be rotated dependent on the direction of the arrow.
I am already using a transform to scale and translate the image when it is zoomed at a particular point, would this affect th other transform?
Thanks anyway for this info
Rich
.
- Follow-Ups:
- Re: Draw a scaled arrow
- From: John B. Matthews
- Re: Draw a scaled arrow
- References:
- Draw a scaled arrow
- From: RichT
- Re: Draw a scaled arrow
- From: Roedy Green
- Draw a scaled arrow
- Prev by Date: Re: Draw a scaled arrow
- Next by Date: Re: visual editor & gridbagLayout problem.
- Previous by thread: Re: Draw a scaled arrow
- Next by thread: Re: Draw a scaled arrow
- Index(es):
Relevant Pages
|