# 3. Rolling image on copperbar

This is the third tutorial in the series. This time we look at another famous Amiga-effect, the copperbar-roller. Here we will roll/rotate an image around a copperbar, yet again using only the Amiga hardware to do it.

THIS DEMO

Here we try to make it seem like we are rotatin an image around a virtual colorbar. The idea is to have the image move on top of the copperbar and at the same time do 2 things to simulate the rotation (as no real rotation doesn't happen here):

• we make all colors of the image and of the copperbar darker towards the top and bottom, as this simulates depth at some level
• at the same time we use horizontal-shifting to simulate a depth on the copperbar. The lookup-table for the horizontal-shift-values are calculated with the standard formula for a circle, x^2 + y^2 = r^2 ==> x = sqrt(r^2 - y^2), we need only positive values

In addition to the effect mentioned above, the only other thing happening here is moving the image upwards according to the wanted speed, in this example we add #40 (1 line) each frame. But, to get an other effect here I put 5 copperbars with rotating images with a small offset regarding the startingline in the image, this makes the wave-effect between the different copperbars.

Next tutorial will show the same effect, but on a 64px high copperbar (in this demo the copperbars are 32px). With a taller copperbar there comes the need of larger horizontal-shifts than 16px, but we will not be using modulos this time.

Write a Comment
bbcode:
[br]  [b][/b]  [i][/i]  [u][/u] If you don't see Verification Code clearly -> Reload