|
Atari coding BBS
Re: Sprite Image Calculating |
Posted by: ggn
|
Feb,04.2013-08:22
|
What WayneKerr says holds and you can use it and it'll work good, but only if your wave consists of sines and nothing else. In the general case you need to calculate the first derivative of the function you used to calculate the curve with and produce a curve with that, which will be your table for sprite orientation. (obviously I don't want to explain this further right now because I don't want to turn this into a maths lecture, but feel free to ask for further info if it's not clear!)
Almost forgot to mention, that table (and Wayne's) will give you the orientation directly only if you have 90 rotated versions of the sprite. If you have less (which I assume you do :)) then you'll have to map the table to sprites. For example, if you have 4 sprites then you'd use the first for 0 to 22.5 degrees, the second from 22.5 to 50 degrees, and so on. (this of course is again oversimplified as you need to compensate for the full 0-360 degree circle).
|
[All messages in this thread] [Start new thread]
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|