![]() |
lighting effect
Is there a simple way to get a light to move in a circle around a certain (x,y) coordinante?
|
Use the sine, cosine circle. Have a single variable, 'angle', and have it increase or decrease (increase = clockwise, decrease = anticlockwise). Then add the image's current x and y to that of the cosine and sine, respectively, of the angle. It's the sine, cosine circle, or the unit circle as they call in Trig and PreCal.
Edit: This is all in radians, so use a MOD (%) or a compound var assignment (a?b:c) to keep the 'angle' var between 0 and 2*pi |
| All times are GMT +2. The time now is 07:34 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.