English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 17 September 2015, 10:42   #1
Powergoo
Registered User
Powergoo's Avatar
 
Join Date: Aug 2013
Location: france
Posts: 20
Help for code an effect called "Blitter Tornado"

Hi everybody,

as soon as I have time I start to code the Amiga.
I use WinUAE (a big thank Toni for that. Verily this emulator is great !)
I would like someone to explain to me how to do on A500 OCS an effect called "Blitter Tornado" ( invented by Virtual Dreams if I remember right )

[ Show youtube player ]
I have the sources of this intro, I looked into but I understand nothing :-(

thank you for advance.


Best regards

Powergoo
Powergoo is offline  
Old 17 September 2015, 11:22   #2
Codetapper
2 contact me: email only!

Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,160
Have a read here.
Codetapper is offline  
Old 17 September 2015, 17:01   #3
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 48
Posts: 1,143
Quote:
Originally Posted by Codetapper View Post
Excellent link!
For those who have difficulties reading Javascript the overarching principle is the following:

1 - divide your screen in rectangular areas
2 - copy each area in a new screen, slightly shifted in a given direction
3 - in the new screen areas where no copied pixels are present, introduce random pixels
4 - display the new screen and swap old/new screen
5 - go to step 1

Code:
     +---------------------+       +----------+----------+
     |                     |       |          |          |
     | CHEEKY      KITTY   |       | CHEEKY   |  KITTY   |
     |                     |       |          |          |
     |                     | +---> +---------------------+ +-+
     |                     |       |          |          |   |
     | WITTY       BUNNY   |       | WITTY    |  BUNNY   |   |
     |                     |       |          |          |   |
     ----------------------+       -----------+----------+   |
                                                             |
+------------------------------------------------------------+ 
|    +----------+
|    |          +-+---------+       +-----------N+---------
|    |    ^     | |         |       | CHEEKY   |O|        |
|    |    |     | |   +->   |       |          |P| KITTY  |
|    +----------+ |         |       +----------+Q|        |
+-> +----------+  +---------+ +---> ABCDEFGHIJKLM+--------- +-+
    |          | +---------+        |         |RVWXYZ012345   |
    |   <-+    | |    |    |        |WITTY    |S|         |   |
    |          | |    v    |        |         |T| BUNNY   |   |
    -----------+-+         |        ----------+U----------+   |
                 ----------+                                  |
                                                              |
+-------------------------------------------------------------+
|    +----------+N---------+
|    | CHEEKY   |O         |
|    |          |P  KITTY  |
|    |          |Q         |
+->  ABCDEFGHIJKLM---------+ +---->    Repeat!  \(^o^)/
     |          RVWXYZ012345
     |WITTY     S          |
     |          T  BUNNY   |
     -----------U----------+
Note that splitting the screen in four will not produce a nice result , you probably need at least 9 areas (3x3) to obtain a pleasing result.

From this simple principle you can then add a lot of variations: copy only one of each pixel every time (alternating which are left/copied every frame), reuse the previous images in a second/third/fourth bitplane, vary the shifting directions over time, copy some bobs in the image from time to time and watch them deform, etc. the possible variations are infinite and I think there are still a lot of nice results yet to be seen.

Last edited by ReadOnlyCat; 17 September 2015 at 17:15. Reason: Cleaned "graphics". :)
ReadOnlyCat is offline  
Old 17 September 2015, 18:02   #4
Powergoo
Registered User
Powergoo's Avatar
 
Join Date: Aug 2013
Location: france
Posts: 20
Quote:
Originally Posted by Codetapper View Post
Thanks for the link Codetapper

Nice explanation ReadOnlyCat I will try to code it now
Powergoo is offline  
Old 17 September 2015, 23:41   #5
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,001
@ReadOnlyCat

that's not completely correct - the new frame will not have any 'empty' areas (i.e. areas not copied to), because it's the new frame that is divided into a grid, becoming the destination of the block copies. The source of each block copy is the one that is slightly shifted. I know it's a minor difference, albeit an important one..
hooverphonique is offline  
Old 18 September 2015, 01:02   #6
Dunny
Registered User

Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 1,330
I did this one in Sinclair BASIC a while ago - you can see the code in the video:

[ Show youtube player ]

But I'll paste it here as it might be more readable!

Code:
10 DIM buffer(2) BASE 0: FOR f=0 TO 1: WINDOW NEW buffer(f),0,-60,800,600: NEXT f: WINDOW HIDE buffer(1)
20 LET sz=32,ps=0,xs=800/sz,ys=600/sz: DIM a$(xs,ys) BASE 0: WINDOW buffer(0)

30 FOR y=298 TO 302: FOR x=284 TO 288: PLOT INK RND*256;x,y: NEXT x: NEXT y

40 LET shift=0: INC ps: FOR i=0 TO 4: LET shift=(shift SHL 1) | ((ps SHR i) & 1): NEXT i
50 FOR y=0 TO ys-1: FOR x=0 TO xs-1: WINDOW COPY buffer(0),x*sz+shift+(16-y)-x,y*sz+shift+x+(16-y),sz,sz TO buffer(1),x*sz+shift,y*sz+shift+16: NEXT x: NEXT y

60 WINDOW COPY buffer(1),0,0,800,600 TO buffer(0),0,0
70 WAIT SCREEN : GO TO 30
Hmm. That's not as easy to understand as I once thought!

D.
Dunny is offline  
Old 18 September 2015, 09:20   #7
musashi5150
move.w #$4489,$dff07e
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 38
Posts: 2,301
@Dunny Nice
musashi5150 is offline  
Old 20 September 2015, 23:36   #8
Dunny
Registered User

Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 1,330
Quote:
Originally Posted by musashi5150 View Post
@Dunny Nice
Thanks. I'm not entirely happy with it - It's not centred on the screen and I'm at a loss as to how to fix that; it seems to only work if the random pixels are placed at a particular point on the screen no matter how I alter the algorithm to match!

D.
Dunny is offline  
Old 21 September 2015, 01:56   #9
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
The vector field that defines the motion is the sum of a horizontal displacement of the columns, a vertical displacement of the rows, and a horizontal and vertical skewing.

The center of motion in this case will be where the displacements net zero, plus half the grid size, but you forget that you have a wider screen, so if you change the terms -x and x into -(x-3) and x-3, or maybe -(x-4) and x-4, for your source coordinates, then you should get the center of motion close to the center of your screen.
Leffmann is offline  
Old 21 September 2015, 05:16   #10
ReadOnlyCat
Code Kitten

 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 48
Posts: 1,143
Quote:
Originally Posted by hooverphonique View Post
@ReadOnlyCat

that's not completely correct - the new frame will not have any 'empty' areas (i.e. areas not copied to), because it's the new frame that is divided into a grid, becoming the destination of the block copies. The source of each block copy is the one that is slightly shifted. I know it's a minor difference, albeit an important one..
Oh, good point, thanks for pointing it out.
I did not realize the random pixels are not needed if the copied areas sources are chosen to cover all pixels of the destination. (Except at the "center" obviously where new input is needed.)

I guess what I described could be considered a variation where additional information is introduced somewhere else than at the "center" of the transformation. I wonder if it would produce a nice result.
ReadOnlyCat is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" rockape News 4 30 January 2013 01:06
Looking for a game called "Search" intelli78 request.Old Rare Games 2 03 January 2013 20:57
One "hole" in each scan line to turn off blitter nasty? mc6809e Coders. Asm / Hardware 1 03 July 2012 13:12
So called "History of Videogames" on Times "Month" CD Antiriad Retrogaming General Discussion 11 26 May 2009 16:41
Search info about a strange game called "Roboter" Daff request.Old Rare Games 3 01 September 2007 21:09

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07854 seconds with 13 queries