Re: [AD] rotate direction

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 2008-10-26 at 15:01 -0600, Trent Gamblin wrote:
> On Sun, October 26, 2008 2:57 pm, Elias Pschernig said:
> > On Sun, 2008-10-26 at 14:53 -0600, Trent Gamblin wrote:
> >> Writing some code for my game I came to realize that the C trig
> >> function sin behaves differently than the al_draw_rotated_*
> >> functions. "sin" starts at 0 (3 o'clock) and moves clockwise so
> >> that
> >> pi/2 is at 6 o'clock. The allegro functions however go counter
> >> clockwise, starting at the same 0 with pi/2 at 12 o'clock.
> >
> > What do you mean?
> >
> > sin(0) = 0
> > sin(pi/2) = 1
> >
> > There's no clockwise in there..
> 
> What I meant is 1 in screen coordinates moves down the screen
> whereas al_draw_rotated_bitmap(... pi/2 ...) will move thing up
> towards the top of the screen.
> 

I see. So right now if you draw a point at

x = cos(angle)
y = sin(angle)

it will not align with al_draw_rotated_*. But I don't think one does
have much to do with the other. If you draw your point at:

x = sin(angle)
y = cos(angle)

it will start at 12 o'clock for example.

The only thing al_draw_rotated_* can do is either rotated clockwise with
a positive paramter or with a negative one - I wouldn't know of any
reason myself to prefer one over the other though. Any math people know
if this is somehow specified?

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/