## Caballero's drawer

Started by avcaballero, May 01, 2018, 05:49:40 AM

#### avcaballero

No need, the competition is ours :lol:

The flag effect is a nice exercise, easier to say than to do

#### Siekmanski

Quote from: caballero on June 03, 2018, 05:55:14 PM
The flag effect is a nice exercise, easier to say than to do

It depends on the algorithm you're using, it can be done with 64 to 128 pre calculated values. ( depending on the animation speed )

Creative coders use backward thinking techniques as a strategy.

#### avcaballero

You have to define the points in the flag that have to be waved, and the tone of color according to it.

Which algorithm do you use?

#### Siekmanski

1 - Create a coordinate grid for the flag including the colors
2 - Create a sine table ( X,Y ) for a full rotation with the radius and steps you need for one coordinate. ( power of 2 size )

3 - Now step with linear interpolation thru the sine table and increase the X,Y coordinate added with the new X,Y sine position.
X starts at 0 degrees.
Y starts at 90 degrees.
Each next horizontal coordinate is one step further in the sine table.

( You can also use the sine values to add some shadow to the colors )

To speed things up, you only have to calculate the left horizontal half of the flag because, it is one full X,Y rotation.
You can copy the coords and colors to the right half of the flag by only updating the X coords.
Creative coders use backward thinking techniques as a strategy.

#### avcaballero

I'd like to see your example, let's see that red/white/blue waving flag  :t

#### Siekmanski

:t
Next week, can't find the sources.
I'll have to make a new one.
Creative coders use backward thinking techniques as a strategy.

#### avcaballero

Ok, I'll be here :t

I'm trying to do the filling of regions for the quadrilaterals

#### avcaballero

Flat color for the flag. Still appears some nasty black points that have to removed... someday

No acelerated graphic card involved here and no predefined function, just the all by hand

#### felipe

They are not nasty, if they were more shiny, they will look as the reflexion from the sun light or something like that.  :icon14:
Btw, this flag seems to say GOOOOAAAALLLL!!!!!!  :icon_mrgreen:

#### daydreamer

really nice flag :t
I had same problem with black pixel when floormapping,either you start filling the first pixel or last filling end pixel doesnt work properly

my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

#### Siekmanski

:t

And some shadow, from the sine table?
Creative coders use backward thinking techniques as a strategy.

#### avcaballero

Yes, a palette according to the sine wave

#### daydreamer

I wish i had time to finish my version of flag,for my swedish national day 6th june :(
my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

#### zedd151

Quote from: daydreamer on June 05, 2018, 06:02:48 PM
I wish i had time to finish my version of flag,for my swedish national day 6th june :(

Better start cracking, you don't have much time left.   :P
Regards, zedd...

#### avcaballero

Hello.

This version is similar to the previous one, except that this one makes an animated gif file in the same folder than the executable with the waving flag. All made with the all-made-by-hand GDI. The interesting of this one is just this: all made by hand.

When I have time I'd like to do:
- Allow to design your own flag, that also could be dumped to an animated gif.
- Improved the painting algorithm to remove the black points