[A83] Re: Sprite Rotation?


[Prev][Next][Index][Thread]

[A83] Re: Sprite Rotation?




> basically, for every pixel, you need: 
> 
> theta = atan2(x,y) 
> 
> r = (x^2 + y^2)^.5 
> 
> pixel_commad_on_or_off(sin(theta) * r, cos(theta) * r) 
> 
Have you heard about texture mapping? You can quite easily solve the
problem using linear interpolation. That means two additions per pixel.
Since the sprite is parallel to the display plane, the gradient used in
the process is constant throughout the whole polygon, therefore you only
need to determine texture coordinates on the left side (or the right,
dpeending on your taste) and start adding the gradient from there.
-- 
http://fastmail.fm - Access all of your messages and folders wherever you
are