Hi, i'm trying to use an AffineTransform
to transform a point to pixels on a 400x400 canvas. What kind of transform would you use?
For example:
given the points
(-1, 1) --transform--> (0, 0) (pixels)
(1, 1) --transform--> (400, 0) (pixels)
(-1, -1) --transform--> (0, 400) (pixels)
(1, -1) --transform--> (400, 400) (pixels)
What part of affine transform would I use?
translation?
scaling?
shearing?
The code i'm using to draw the points is as follows:
//paint method
AffineTransform at = new AffineTransform();
//at.translate(... ??
//at.scale(... ??
//at.shear(... ??
Graphics2D g2d = (Graphics2D)g;
g2d.setTransform(at);
//fill small point
g2d.fillRect(20, 50, 3, 3);
thanks.