So I've decided to make some simple animations with python and I came to the issue of getting parts to rotate and move together. I decided to put parts together on a smaller canvas (canvas for the leg placed on the main canvas) but I can't get the canvas to rotate. Is there a better way to do this or any way to rotate the canvas?
Any help would be appreciated.

Recommended Answers

All 5 Replies

In stackoverflow there was code on how to use complex numbers for rotation of polygon:

And ActiveState explains how to change oval to polygon for rotation:

You might be better off using for example pygame:

ok well I know how to rotate parts but the problem is I have an arc and 2 rectangles that I need to rotate together but can't seem to get to work.
any help would be appreciated.

I think that you should manage the rotation of arch more simply by rotation center and starting point of the arch (length of arch in radians do not change), without full transformation to polygon.

Sorry pyTony I ignored your first link since I knew how to rotate polygons and have now noticed that I was missing the offset/center piece which has solved the problem for me. Guess that will teach me to think I know something and ignore a related link.

The second link explains polygonization of oval, the center arch starting point was my own idea for simple circular case. Sometimes it is also good to know tgo think too concrete, if you have not unmoving things you can rotate the axes opposite direction and redraw for effect of rotating everything.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.