Rotation in relations to another object

Hi, so i’m trying to rotate another shape in relations to another shape.
but im not able to do so, how should i go about it(object/class based)?.

best you use
translate(x1,y1);
to move to the center of the first object
and
rotate(ang);
and now draw second object

could now use
ang += dang;
change the rotation little bit in every draw loop


a general answer if you should use class is not possible
it depends on
++ will you later make many objects like a arrayList of class
++ will they be of different properties ? like color, size…
++ would using a class internal method clean up your code

+++ do you want to learn class ?

https://processing.org/tutorials/transform2d/

:slight_smile:

1 Like