123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|553|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> sine wave animation?

Wed, 02 Apr 2008, 06:48
spinal
Does anyone have an example of a simple sine wave animation, something like the psp background? It does not need to be anywhere near as good as that, just a wiggling line across the screen.

-=-=-
Check out my excellent homepage!
Wed, 02 Apr 2008, 07:06
mike_g
This is about as crude as you can get, but with a little work you could probably turn it into something that looks nice:

Wed, 02 Apr 2008, 07:24
Phoenix
If you want a PSP-style background, you're probably better off pre-making it in some image editing program.

In addition to Mike's solution, here's a quick Blitz example:

Wed, 02 Apr 2008, 07:51
Jayenkai
Or an even more wibbly wobbly thing...



-=-=-
''Load, Next List!''
Wed, 02 Apr 2008, 09:53
JL235
As usual a really nice effect by Jay. Thanks, I might use that.
Wed, 02 Apr 2008, 16:13
spinal
took peonix's and tweaked it a little...

you need line.gif should be bmp but jay's thinumy cant upload bmps.



I cheated a little with the transparency.


also, can someone think of a better way to do this...


-=-=-
Check out my excellent homepage!
Wed, 02 Apr 2008, 16:34
Jayenkai


Extra dithering allows for a 3rd and 4th wave, but due to it doing drawimage rather than drawblock, it has slowed it down somewhat..

-=-=-
''Load, Next List!''
Sun, 06 Apr 2008, 14:29
JL235
Here is my version which I am planning to use. It doesn't draw the whole line on everyframe and instead draws say half or a quarter of it. The lines which are missed are then drawn on the next frame, the one after, and so on. This spreads the load across multiple frames, but reduces quality.

In this example I think I have it set to skip every 12 lines, but it draws 4 of them (1 for each wave). So it's only drawing a third of the screen (12 / 4) on each frame. This is also needed as I generate a whole new line for each frame with a new colour. In order to do that quickly I precalculate double values stored into an array for each pixel in the line. I then just multiple the r/g/b values for the whole line by the double for that pixel and so can create the gradient very quickly.

I also made a SinWave object so it'd be easy for me to have them change speed and size over time too, which I might add.

Enjoy!
Sun, 06 Apr 2008, 14:48
Jayenkai
V.cool!

Shame it took 3 weeks for Java to start before I saw it running, but otherwise very good!


-=-=-
''Load, Next List!''
Sun, 06 Apr 2008, 15:23
JL235
Java works really well in Opera, I'm impressed!