• Welcome to Dark Bit Factory & Gravity.
 

Need Help Waving PIC

Started by Cod1ngFreak, April 15, 2012

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Cod1ngFreak

Hi,
I need a little help, and that I wanted a wavy image animation program.

This should look something like:


The X are the Pixels from the image

XXXXXXXX -->
XXXXXXXX
XXXXXXXX

XXXXXXXX
XXXXXXXX - >

       XXXXXXXX
  <--XXXXXXXX


  <--XXXXXXXX
XXXXXXXX

I hope you understand my question based on the description.
Or is there an easier way to achieve this?

Sorry for my bad english :(


Shockwave

Hi Cod1ngFreak.  So we can answer your question, what graphics library are you using in Freebasic (Tinyptc, fbgfx, sdl, opengl etc)?

To make a wavy offset like that, the best way is to use the sin command to generate a nice sine wave offset that can be added to each successive line of the picture when it's being drawn.

Have you written any of the code?
Shockwave ^ Codigos
Challenge Trophies Won:

Knurz

Hi.

Take a look at a NeHe-Tutorial : http://nehe.gamedev.net/tutorial/flag_effect_(waving_texture)/16002/

This explains the basics of this "effect" and gives you a sample.

Remember what the dormouse said: Feed your head

Dr_D

Hey guys... long time no see.

Cod1ngFreak, I was messing around with FreeBASIC a few years ago and made something to that effect. It's probably not what you expect... and not really what the functionality was designed for, in my opinion, but it does use a sine wave to manipulate an image as in your ascii drawing.  Hope it's useful. :)

http://drd.owlbox.net/download.php?id=108
The Dr. is INsane!!!