Aug-25-2021, 07:32 PM
(This post was last modified: Aug-25-2021, 07:32 PM by deanhystad.)
At least use this part:
When you rotate your image you have to use degrees for the angle. When figuring out where to draw the image you need to use radians for the angle of math.cos(angle) and math.sin(angle). 1 radian = 180 / PI or approximately 57.29 degrees
Your last example still shows you using the top left corner of the surface.
Does noob mean you don't know trigonometry? No insult, just asking. How about linear algebra? Matrix math?
Quote:Your last example is still using degrees with the math library. You need to use radians. You should also use center when you position the image. It is much easier than trying to position the corner. Remember that rotating the image/surface changes the size, and this changes the location of the corner relative to the center of the image.
When you rotate your image you have to use degrees for the angle. When figuring out where to draw the image you need to use radians for the angle of math.cos(angle) and math.sin(angle). 1 radian = 180 / PI or approximately 57.29 degrees
Your last example still shows you using the top left corner of the surface.
Sail_rect = Sail.get_rect(topleft = (dx, dy))This makes it really complicated to compute dx and dy. Instead you should use the center of the image.
Sail_rect = Sail.get_rect(center= (dx, dy))And compute dx and dy to be the where the center of the sail/rectangle should be.
Does noob mean you don't know trigonometry? No insult, just asking. How about linear algebra? Matrix math?