I'm trying to make an artificial horizon indicator. So far I can control the Pitch. but when I try to rotate the rectangle on the top center it all goes crazy.
I tried this from an example I found. it seems to work here, but not in my code
// Translate origin to center translate(width/2,height/8-100+mouseY+60);
// The greek letter, theta, is often used as the name of a variable to store an angle // The angle ranges from 0 to PI, based on the ratio of mouseX location to the sketch's width. float theta = PI*mouseX / width;
// Rotate by the angle theta //translate(0,0-mouseY); rotate(theta);
// Display rectangle with CENTER mode rectMode(CENTER); rect(0+50,0,100,100); }