Dark Bit Factory & Gravity

PROGRAMMING => Purebasic => Topic started by: va!n on October 01, 2007

Title: RotoScope (a new demo effect?)
Post by: va!n on October 01, 2007
Hi guys! here is a graphic effect i coded for a coding competition by a german pb forum. deadline was 30.sep.2007 @ 23:59... Here is what i come up with... (i don't know to have seen that kind of fx before. runs in 800x600x32)  zip cointains exe and full sources...
Title: Re: RotoScope (a new demo effect?)
Post by: Jim on October 01, 2007
Good effect, and definitely Karma+ for posting source.

Also, I'm very pleased to see that your degrees to radians function is accurate to 18 decimal places, 0.017453292500000002, that's down to the attometer level, about 1 quintillionth of a degree :D, or one billion, billion, billionth of a pixel ;D

Jim
Title: Re: RotoScope (a new demo effect?)
Post by: p01 on October 01, 2007
Kaleidoscope are not new to the scene :P
Also using a rotozoom to "feed" it is rather obvious as it produces many rotating patterns. See KaleidoSkop, a 256b intro by Beetle / 3SC in 2000 (http://www.256b.com/demo/120) or in a loop, an insane 1k intro on C64 by Ate Bit in 2006 (http://www.pouet.net/prod.php?which=24333)

Kudos for sharing the source.
Title: Re: RotoScope (a new demo effect?)
Post by: benny! on October 01, 2007
Love the kaleidoscope fx, va!n. Nice one. Good luck with your entry in the competition.
Title: Re: RotoScope (a new demo effect?)
Post by: Shockwave on October 01, 2007
That is a pretty good effect, I'd like to wish you good luck in the competition! :)

Looking at the source I am sure that it can be optimised quite a lot more.
The two matrix constants can be computed outside the loop;

Code: [Select]
    MO1= COS (THETA)
    MO2= SIN (THETA)

And then inside the loop;

Code: [Select]
        ONE AXIS OF ROTATION
        XXX=X(L)
        YYY=Y(L)
       
        X(L) = MO1 * XXX - MO2 * YYY
        Y(L) = MO1 * YYY + MO2 * XXX

Which is probably still not the way I'd go about making this effect, but it would be a little faster than it is at the moment.

If I had to code this in software I'd make a very quick and dirty linear texture mapping routine, there would be no problem with warping of textures because there is no Z Co-ordinate.

But anyway I'll STFU now, the effect looks nice and the best of luck with the comp :)
Title: Re: RotoScope (a new demo effect?)
Post by: p01 on October 01, 2007
Dunno the langage used here but surely you can replace:
Code: [Select]
While lTexturePixelX < 0 : lTexturePixelX = lTexturePixelX + 255 : Wend
While lTexturePixelY < 0 : lTexturePixelY = lTexturePixelY + 255 : Wend

If lTexturePixelX > 255 : lTexturePixelX = lTexturePixelX - 255 : EndIf
If lTexturePixelY > 255 : lTexturePixelY = lTexturePixelY - 255 : EndIf
by something like:
Code: [Select]
lTexturePixelX &= 255
lTexturePixelY &= 255

Also in a rotozoom, the slope is continous, therefore the inner ( X ) loop can be summed up to:
Code: [Select]
xLoopX += xLoopDeltaX
xLoopY += xLoopDeltaX
And the outer ( Y ) loop to:
Code: [Select]
xLoopX = ( yLoopX += yLoopDeltaX )
xLoopY = ( yLoopY += yLoopDeltaY )

HTH
Title: Re: RotoScope (a new demo effect?)
Post by: taj on October 01, 2007
The effect is very pleasing on the eyes. Karma++ for source.
Title: Re: RotoScope (a new demo effect?)
Post by: Stonemonkey on October 01, 2007
Nice one Va!n, goodluck with the compo.
Title: Re: RotoScope (a new demo effect?)
Post by: va!n on October 05, 2007
compo is running atm at www.purebasic-lounge.de ^^
Title: Re: RotoScope (a new demo effect?)
Post by: Shockwave on October 05, 2007
Good luck mate :)
Title: Re: RotoScope (a new demo effect?)
Post by: DeXtr0 on November 11, 2007
Great code and great Idea.
I'm not sure if I have seen this before but I think I have.

However well done. Karma ++ and good luck with the competition !

Keep us informed about your position (after the votings)  :-X

Cheers,
DeX