blog posts

databases (1) django (1) drupal (2) java (4) processing (7) wamp (1) yahoo pipes (1)

Monday, 14 February 2011

Processing How to use the zoom feature

There is a method that is provided by the GiCentre which uses a class called
zoomPan.

To use this feature you need to download from the GiCentre site using this link

now you need to choose a class
ZoomPan zoomer

now create an instance of the zoom class. This need to be placed within the void setup() method.
eg zoomer = new ZoomPan(this); //  keyword this points to the zoomPan object


now you need to place zoomer.transform();   in the draw method. Remember the draw method is called again and again.

Now lets look at another features. There is feature that runs whats inside a particular loop


// if you want a certain task to be accomplished for example writing to appears on circles
 if(zoomer.getZoomScale() > 3) // the greater then 3 refers to how much you have zoom in
/* if you want to find out what your current zoomed position is you can use the print command
to return the current position 
 */
println(zoomer.getZoomScale)
    {
    text(countryName, x+pixel, y); 
}



Exercises

1. develop a zoom function which draw a group of triangle whens you have zoomed in with positon level 3
2.  make a button which when clicked on will zoom in to a particular position
3. disable the mouse panning and only allow the mouse scrole to work 

No comments:

Post a Comment

Popular Posts