We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Zooming and panning across a sketch
Page Index Toggle Pages: 1
Zooming and panning across a sketch (Read 724 times)
Zooming and panning across a sketch
Aug 20th, 2008, 1:09pm
 
I often find that I need to zoom into a sketch and then pan across it. Adding the relevant scaling and translation commands can achieve this, but if other mouse actions or transformations are also present in a sketch, this can get a bit confusing.

I therefore ended up creating a stand-alone class to perform zooming and panning with the mouse that can be added to most sketches with minimal change in code required.

As the class is quite long, I've provided a separate page on Adding zooming and panning to a sketch

If this is useful, I could add this to the 'hacks' section, but I thought I would post it here first and invite any comments or suggestions for improvements.

Thanks,

Jo.
Re: Zooming and panning across a sketch
Reply #1 - Aug 20th, 2008, 1:58pm
 
Hey, thanks, maybe that is one way to achieve what i asked for just some hours ago...

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1219184424
Re: Zooming and panning across a sketch
Reply #2 - Aug 21st, 2008, 10:31pm
 
Nice! Great contribution.
Re: Zooming and panning across a sketch
Reply #3 - Aug 22nd, 2008, 9:45pm
 
I actually need help right now with something like this, maybe someone can help me,

basically i've done an animation at 720x405 (opengl) and want to scale it up to HD at 1280x720.  So I'll need to change the sketch size obivously, but don't know how to zoom in the camera so that it matches the orginal exactly,

could I use the above code to do this? any other help welcome!
Re: Zooming and panning across a sketch
Reply #4 - Aug 24th, 2008, 2:50pm
 
actually just ignore my stupid question, turns out when i scaled up the sketch, everything remains in place, but at a nice higher resolution.  sometimes Processing does just what you want it to Smiley
Page Index Toggle Pages: 1