basic rotation

By zett

Hero (608)

zett's picture

25-08-2003, 23:28

Hi,
I have a problem Crying Crying Crying .
I try to create a program thats make it posible to rotate a patern 16X16 in 16 steps.
but it don't work
can anybody create me a program in basic that made this posible????

I hope

Thank you ,

Rudi "Lord Zett" Westerhof

Login or register to post comments

By anonymous

incognito ergo sum (116)

anonymous's picture

26-08-2003, 01:05

Rotation is tough. It's Pythagoras' fault Wink
There is no automatic solution possible for a low-res low-color screen.
Best is to use a PC graphic editor (like PSP) and edit each step by hand.

For Project Banshee we rotated a 16x16 sprite in 32 steps in Deluxepaint (on amiga ^^Wink and then edited the results in AGE.

By zett

Hero (608)

zett's picture

26-08-2003, 01:16

no I want it don in basic
Ineed it becours it for a game im develping.

By anonymous

incognito ergo sum (116)

anonymous's picture

26-08-2003, 03:40

Rotation is not something you will want to do in real-time.

However:

10 SCREEN 5 : CLS : DEFINT A-Z : DEFSNG R
20 FOR I = 0 TO 15 : LINE ( I , I ) - ( 15-I , 15-I ) , 15-I , B : NEXT I
30 FOR D = 0 TO 359 ' Rotate 360 degrees
40 RZ = D * (4 * ATN (-1) ) / 180 ' Convert degrees to radians
50 RS = SIN (RZ): RC = COS (RZ)
60 FOR Y = 0 TO 15 : FOR X = 0 TO 15
70 X1 = X * RC - Y * RS
80 Y1 = X * RS + Y * RC
90 PSET (50+X1,50+Y1) , POINT ( X , Y )
100 NEXT X,Y
110 NEXT D

Still, without manual anti-aliasing it looks like shite.

By BiFi

Enlighted (4348)

BiFi's picture

26-08-2003, 08:09

And anti-aliasing in Basic will slow it down even MORE.

By Argon

Paragon (1119)

Argon's picture

26-08-2003, 13:21

I think a different sprite for every position would be a better option than doing it realtime...

K.

By wolf_

Ambassador_ (9956)

wolf_'s picture

26-08-2003, 13:34

You definitly don't want realtime rotation on an msx.

Besides, a 16x16 tile, rotated 45 degrees requires a bigger area. so your base-sprite can't be full 16x16.

lets see..

16x16

rotated 45 degrees, using pytho....blah.. that guy..: 16*16 + 16*16 = 512

sqr(512) = 22.6 .. let's say 23

so your 45 degree requires a 23x23 tile ..

By zett

Hero (608)

zett's picture

27-08-2003, 14:32

GuyveR800 i thank you.
I olmost gona love you!!!!

thank you,

Tongue oO Smile