PDA

View Full Version : Result of 90 degrees rotation is wrong



Wetgos
10-09-2003, 05:20 PM
When I was programming a rotation event for a game,
I discovered that when I tell PowerDraw to rotate an image
90 degrees, the result is an image that is rotated approximately 30 degrees.
I have a simple (Delphi) function to solve this.


function DegToPower(Angle: Real): Extended;
begin
Result := (Angle / 360) * 256;
end;

I hope this makes the implementation of the rotation feature of PowerDraw easier.

Madarco
27-05-2004, 05:49 PM
I suggesto to change directly the PowerTypes unit in the pRotate4 procedure:


// convert angle to radians
//Beta:= (Angle * Pi) / 128;

to:


// convert angle to radians
Beta:= (Angle * Pi) / 180;