RESOLVED: How to find out the rotation of a shape?
in
Programming Questions
•
4 months ago
I promised I searched this and I'm sure the answer is easy, but how to I find out how much a shape it rotated?
I've created a shape called "knob" and every time you click the mouse it rotates .25 radians:
void mousePressed()
{
knob.rotate(.25);
}
What I'd like to do is store the current amount of rotation is to a variable then println() the amount with every click. Something along these lines (this is wrong obviously):
void mousePressed()
{
knob.rotate(1);
rotateVar = knob.rotation();
println(rotateVar);
}
Thanks,
Shields
I've created a shape called "knob" and every time you click the mouse it rotates .25 radians:
void mousePressed()
{
knob.rotate(.25);
}
What I'd like to do is store the current amount of rotation is to a variable then println() the amount with every click. Something along these lines (this is wrong obviously):
void mousePressed()
{
knob.rotate(1);
rotateVar = knob.rotation();
println(rotateVar);
}
Thanks,
Shields
1