Rotate around origin
BlitzMax Forums/BlitzMax Beginners Area/Rotate around origin
| ||
Hi. How can I calculate the position of an object which rotates around the origin or an other point on the screen. for example if I want to draw an oval at the position 300,400 at the beginning an then it should rotate around the origin. How can I calculate the position depending on the angle of the rotation? Sry, I'm not that good in Trigonometry^^ Thank you. Lukasha.. |
| ||
Plot xPos + ( Sin(angle)*radius ),yPos - ( Cos(angle)*radius ) EDIT: I'm assuming you mean a circle and not an oval; xPos and yPos are the x and y of the origin, obv. |
| ||
This should help. |
| ||
Thx, you helped me.. |
| ||
You could use Max2D's handle system... ...Not a particularly clear example but it was to hand. You should pay particular attention to 'TVectObj.Draw()' and bear in mind that the current 'system scale' will also play a part. |