Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: R@dioman on May 03, 2003, 10:57:42 PM



Title: Sprite rotation...
Post by: R@dioman on May 03, 2003, 10:57:42 PM
I want to use the sprite rotation routines from cosmox or rellib, but at every 90 degree increment, it jerks the sprite a bit. Is it just my faulty programming, or is it the routine? Is there any routines out there that gives you a smooth 360 degree rotation? Thanks


Title: Sprite rotation...
Post by: toonski84 on May 03, 2003, 11:01:56 PM
well, since rel's visiting his old man i should probably say something like "could i see the program?"  are you including both 0 and 360 as degrees in your loop?  at what degree does it jerk?


Title: Re: Sprite rotation...
Post by: wizardlife on May 03, 2003, 11:07:47 PM
Quote from: "R@dioman"
I want to use the sprite rotation routines from cosmox or rellib, but at every 90 degree increment, it jerks the sprite a bit. Is it just my faulty programming, or is it the routine? Is there any routines out there that gives you a smooth 360 degree rotation? Thanks


What increments are you using? Surely you're not rotating each degree? His routines would be working in radians anyways... I'd go in 5 or 8 degree notches, or just make 16/32 directional sprites manually.


Title: Sprite rotation...
Post by: toonski84 on May 03, 2003, 11:17:22 PM
i rel's rotation routines do go by degree.  most libs i've seen have integer increments, but it's usually something like up to 255 or something.  i'll have to check the library itself.

but the program itself would be helpful so we could see whether or not it's the program or the routine.

edit:  yeah, it's 0-359.


Title: Sprite rotation...
Post by: R@dioman on May 04, 2003, 12:51:19 AM
Well, here's an example using cosmox. It has the same problem: (right-click, save-as...)

www.geocities.com/juice801980/temp.zip

It jerks at every 90 degrees. :???:


Title: Sprite rotation...
Post by: relsoft on May 05, 2003, 02:59:46 AM
Hmmmm... Didn't notice it. Lachie use it on REO and it didn't have any probs.

There's an example file there.  Are you by any chance using a non released ver?  You could look at the source to see if the SHR is:

SHR 8
instead of Shr 7

as shifting 8 would mess the sign bit.

if you are using the unrealeased crap ver then you need to get the newest ver which I could only provide via email as my site is probaby dead already.

Be back on Thursday.