Hi dudes, this is a question i had for a long time, and now that i had to face it (by “force”), i decided to post it here
I have a canvas big 800x640 (its just a piece of the whole frame) and i need to support different “scales”
My coordinate system is ±400 x, ± 320 y.
Instead of having a lot of zoom capabilities (thus a lot of different scales) i decided to make just 4 scales : x1, x2, x3, x4.
So for x2 for example, my canvas should represent a 1600x1280 space (± 800x, …)
I think this should be way easier than zooming with the mousewheel.
So what i was thinking is to divide everything on my shapes (what is drawn into the canvas) by the scale.
For example if my rectangle is at 120, 100, has a width of 100 and a height of 50, i should draw it as follows (considering x2 scale):
x: 60
y: 50
width: 50
height: 25
So dividing is the way to go? is that hard to make the zoom with the mousewheel and having multiple scales?
Thanks in advance for your time and patience
EDITED: im using standard j2se, im using java2D (i guess), not open gl nor any stuff like that
EDITED2: im a big noob (just if you didnt notice that)