Dark Bit Factory & Gravity
PROGRAMMING => Purebasic => Topic started 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...
-
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
-
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.
-
Love the kaleidoscope fx, va!n. Nice one. Good luck with your entry in the competition.
-
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;
MO1= COS (THETA)
MO2= SIN (THETA)
And then inside the loop;
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 :)
-
Dunno the langage used here but surely you can replace:
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 : EndIfby something like:lTexturePixelX &= 255
lTexturePixelY &= 255
Also in a rotozoom, the slope is continous, therefore the inner ( X ) loop can be summed up to:xLoopX += xLoopDeltaX
xLoopY += xLoopDeltaXAnd the outer ( Y ) loop to:xLoopX = ( yLoopX += yLoopDeltaX )
xLoopY = ( yLoopY += yLoopDeltaY )
HTH
-
The effect is very pleasing on the eyes. Karma++ for source.
-
Nice one Va!n, goodluck with the compo.
-
compo is running atm at www.purebasic-lounge.de ^^
-
Good luck mate :)
-
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