Help making a shape free rotate

I used the great sample code below to build a much larger project. I want the shape on the screen to freely rotate on the Y axis until I press a key to stop the rotation at a given point and then use the Peasy controls to rotate/zoom/etc.

A typical example is that I have 100* the spots and I am watching the screen until I see a cluster, press the key, zoom in, color-select the item to show the stats of the dot, and then press the same key to let the image start rotating again from that point.....

I can figure out most of it, just not how to make it rotate freely. I tried "rotateY(radians(2));" in multiple locations but no effect.... Thank you ahead of time for all of the effort and help so far on my projects.

========================================

UPDATE

I figured out my own issue but posting answer here for others to know. If you are using Peasy & PShapes and want to do what is described above, you must put the cam.rotateY OUTSIDE of the pushMatrix. If you put it inside it has other unexpected results.

void draw() {
  if (freemode) cam.rotateY(radians(1));
  pushMatrix();
  background(222);
  if (showInfo)  showHUDtext();
  Brain.draw(); 
  popMatrix();  
}
Tagged:

Answers

  • Answer ✓

    Thanks for sharing your own solution, always a good idea.
    Suggestion: post the solution as a response, so that you can accept it (even if it sounds odd...). This allows to make the thread as answered.

Sign In or Register to comment.