Rotate problem
in
Contributed Library Questions
•
2 years ago
Hi all,
Im trying to rotate in this program but every time it resets the rotation
How i can stop the rotation and start again by touch?
- import oscP5.*;
- import netP5.*;
- import tuioZones.*;
- TUIOzoneCollection zones;
- PFont font;
- float rot_inicial, rot_atual,rodar;
- void setup(){
- size(screen.width,screen.height);
- zones=new TUIOzoneCollection(this);
- zones.setZone("zone1", width/2,height/2,300);
- smooth();
- font = loadFont("Serif-24.vlw");
- textFont(font);
- }
- void draw(){
- background(0);
- fill (150);
- zones.drawCirc("zone1");
- fill (0);
- if (rot_atual != rot_inicial)
- {
- rodar = rot_atual;
- translate(width/2, height/2);
- rotate(rodar*2*PI);
- text("rotate me",0,0);
- rot_atual = zones.getGestureRotation("zone1");
- }
- else
- {
- rot_inicial = zones.getGestureRotation("zone1");
- rodar = rot_inicial;
- translate(width/2, height/2);
- rotate(rodar*2*PI);
- text("rotate me",0,0);
- }
- rot_atual = zones.getGestureRotation("zone1");
- }
1