C
Chantal
Hello,
I'm translating and rotating a polygon with graphics2D (g2) and
everything works fine :
g2.translate(x, y);
g2.rotate(r);
g2.drawPolygon(pol);
//reinit
g2.translate(-x, -y);
g2.rotate(-r);
But I would like to know if it's possible to get the new coordinates of
the polygon, I mean after the rotation and translation are done.
To be complete, I'm doing a translation and a rotation on a image too.
So i draw first my image and after I draw my polygon.
So my image and polygon perfectly match but I need to get the new
coordinates of my polygon.
I tried to rotate and translate my polygon with maths without using
dedicated graphics2D functions (the image is still translated and
rotated with graphics2D) but the figures don't match anymore (several
pixels of difference).
So, if there was a possibility to get the new coordinates of my polygon
with the first solution (everything done with graphics2D), it would be
great !!
Thanks in advance, )
Chantal
I'm translating and rotating a polygon with graphics2D (g2) and
everything works fine :
g2.translate(x, y);
g2.rotate(r);
g2.drawPolygon(pol);
//reinit
g2.translate(-x, -y);
g2.rotate(-r);
But I would like to know if it's possible to get the new coordinates of
the polygon, I mean after the rotation and translation are done.
To be complete, I'm doing a translation and a rotation on a image too.
So i draw first my image and after I draw my polygon.
So my image and polygon perfectly match but I need to get the new
coordinates of my polygon.
I tried to rotate and translate my polygon with maths without using
dedicated graphics2D functions (the image is still translated and
rotated with graphics2D) but the figures don't match anymore (several
pixels of difference).
So, if there was a possibility to get the new coordinates of my polygon
with the first solution (everything done with graphics2D), it would be
great !!
Thanks in advance, )
Chantal