Qbasicnews.com
April 09, 2020, 05:26:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Image rotation  (Read 3182 times)
andy
Senior Member
**
Posts: 175



WWW
« on: November 10, 2003, 10:28:51 AM »

How can I rote an image. not around a central point, but like below for example.


change from
0,0,1,1,1,0,0
0,0,0,1,0,0,0

to
0,0,0,1,0,0,0
0,0,1,1,1,0,0


How can I do this withouit rewriting the sprite.
Do you know what I mean?
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
toonski84
__/--\__
*****
Posts: 2567



« Reply #1 on: November 10, 2003, 11:12:21 AM »

You mean right angle rotations?  well, that all depends on how you're storing the sprite.  Are you using GET/PUT?  Then you can't without rewriting the sprite.  Are you using your own routine?  Then just make a new routine that draws it rotated.  Are you using any major graphics library?  Then all of them come with routines to rotate a sprite right angles, and even around a point.
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Neo
Na_th_an
*****
Posts: 2150



« Reply #2 on: November 10, 2003, 11:24:49 AM »

Toonski covered all possibilities Smiley
Logged
TheBigBasicQ
*/-\*
*****
Posts: 4550



WWW
« Reply #3 on: November 10, 2003, 04:32:59 PM »

Future.Library - learn to use it Wink
Logged
andy
Senior Member
**
Posts: 175



WWW
« Reply #4 on: November 11, 2003, 10:19:18 AM »

I would use futur.lib, but my version of qb (v1,1) won't allow it. I can't download v4.5 or 7.1 as I don'thave the internet, except for at school where downloading is barred. (stupid dans guardian program).
My laptop which has v7.1 on is currently off for repair.

I wont to write my own routine, toonski any more info please.
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #5 on: November 12, 2003, 05:03:31 AM »

RelSpriteFlip ;*)
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
andy
Senior Member
**
Posts: 175



WWW
« Reply #6 on: November 12, 2003, 10:21:14 AM »

What is relspriteflip
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
ak00ma
Ancient Guru
****
Posts: 669



« Reply #7 on: November 12, 2003, 10:59:31 AM »

Give him some code, so he can learn....
Logged

B 4 EVER
toonski84
__/--\__
*****
Posts: 2567



« Reply #8 on: November 12, 2003, 11:23:37 AM »

look, download a different version of qb, first of all.  qb1.1 was really cripple-ware for qb4.5.  It came with dos to promote qb.   But it really is crippled.  You can't compile, and you can't do a lot of important things, like use .qlb libraries.

There are a few options for you, though.  AFLib is a port of Rellib that uses strings of machine code with call absolute to do graphics.  This is, however, a bad idea because you waste a lot of your near memory in loading the library.  If you just download qb4.5(it's abandoneware, microsoft dropped support and it's been unavailable to buy for years), you can use other libraries like UGL, Rellib and CosmoX as if they were part of your standard library.
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
andy
Senior Member
**
Posts: 175



WWW
« Reply #9 on: November 12, 2003, 04:12:05 PM »

As I said before, I can't download, but I can pick up e-mails. So could someone please e-mail it to me.
Please PM me first so I don't get loads of e-mails.

My email is:
andrew_parlane@hotmail.com
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #10 on: November 12, 2003, 04:31:49 PM »

I you can't download, you won't be able to download your attachments from hotmail Sad
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
webberboy
Member
*
Posts: 95



WWW
« Reply #11 on: November 12, 2003, 09:45:18 PM »

for x=1 to 5
  for y=1 to 2
    array1(x,y)=array2(x,3-y)
  next
next

this should work, i think.
Logged

url=http://webberboy.no-ip.com]Fine Hand-Crafted Pens[/url]
Pneumonoultramicroscopicsilicovolcanoconiosis:  Noun, A hypothetical, invented disease of the lungs, caused by inhaling mineral or metallic dust, such as silicon and quartzite, over a long period.]
Blitz
I hold this place together
*****
Posts: 853



WWW
« Reply #12 on: November 13, 2003, 06:36:07 AM »

Simple man, instead of writing the image from ymin to ymax, write it from ymax to ymin. Since you only need 180 degree rotation. Hope you get the idea.


Code:

defint a-z
sub PutFlipV ( dstseg as integer, xd as integer,
               yd as integer, image() as integer )
   
    static dstofs as long
    static xmin as integer, ymin as integer
    static xmax as integer, ymax as integer
   
   
    def seg = dstseg

    ''
    '' Calculate offset
    ''
    dstofs = yd * 320& + xd    
   
    ''
    '' Calculate sprite dimensions ( or not :P )
    ''
    xmin = 0
    ymin = 0
    xmax = 64-1
    ymax = 64-1

    ''
    '' Blit sprite
    ''    
    for  y  = ymax to ymin step -1
        for  x = xmin to xmax
            poke dstofs+x, image( y, x )
        next x
       
        dstofs = dstofs + 320
    next y
   
   
    def seg
end sub
Logged

oship me and i will give you lots of guurrls and beeea
andy
Senior Member
**
Posts: 175



WWW
« Reply #13 on: November 19, 2003, 05:20:22 PM »

Thanks, I will be able to download it, school have banned downloading off sites but not from e-mails yet?HuhHuh

Anyhow someone is already sending me it "TOM"?
but thanks anyway

Code looks good
Logged

eminiscing about trapezoids in conjunction with stratospherical parabolas:

No questions asked.

www.stickskate.com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!