### Author Topic: Caballero's drawer  (Read 1672 times)

#### caballero

• Member
• Posts: 1043
##### Re: Caballero's drawer
« Reply #15 on: June 03, 2018, 05:55:14 PM »
No need, the competition is ours

The flag effect is a nice exercise, easier to say than to do
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -

#### Siekmanski

• Member
• Posts: 1591
##### Re: Caballero's drawer
« Reply #16 on: June 03, 2018, 06:42:38 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 )

What is your algorithm?
Creative coders use backward thinking techniques as their strategy.

#### caballero

• Member
• Posts: 1043
##### Re: Caballero's drawer
« Reply #17 on: June 03, 2018, 07:20:44 PM »
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?
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -

#### Siekmanski

• Member
• Posts: 1591
##### Re: Caballero's drawer
« Reply #18 on: June 03, 2018, 08:07:25 PM »
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 their strategy.

#### caballero

• Member
• Posts: 1043
##### Re: Caballero's drawer
« Reply #19 on: June 03, 2018, 08:49:37 PM »
I'd like to see your example, let's see that red/white/blue waving flag
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -

#### Siekmanski

• Member
• Posts: 1591
##### Re: Caballero's drawer
« Reply #20 on: June 03, 2018, 09:15:35 PM »

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

#### caballero

• Member
• Posts: 1043
##### Re: Caballero's drawer
« Reply #21 on: June 03, 2018, 09:53:04 PM »
Ok, I'll be here

I'm trying to do the filling of regions for the quadrilaterals
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -

#### caballero

• Member
• Posts: 1043
##### Re: Caballero's drawer
« Reply #22 on: June 04, 2018, 02:27:24 AM »
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
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -

#### felipe

• Member
• Posts: 895
• Eagles are just great!
##### Re: Caballero's drawer
« Reply #23 on: June 04, 2018, 02:42:31 AM »
They are not nasty, if they were more shiny, they will look as the reflexion from the sun light or something like that.
Btw, this flag seems to say GOOOOAAAALLLL!!!!!!
Felipe.

#### daydreamer

• Member
• Posts: 489
##### Re: Caballero's drawer
« Reply #24 on: June 04, 2018, 03:15:24 AM »
really nice flag
I had same problem with black pixel when floormapping,either you start filling the first pixel or last filling end pixel doesnt work properly

Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

#### Siekmanski

• Member
• Posts: 1591
##### Re: Caballero's drawer
« Reply #25 on: June 04, 2018, 04:58:19 AM »

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

#### caballero

• Member
• Posts: 1043
##### Re: Caballero's drawer
« Reply #26 on: June 05, 2018, 04:00:40 AM »
Yes, a palette according to the sine wave
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -

#### daydreamer

• Member
• Posts: 489
##### Re: Caballero's drawer
« Reply #27 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
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

#### zedd151

• Member
• Posts: 847
##### Re: Caballero's drawer
« Reply #28 on: June 05, 2018, 06:25:20 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.
I'm not always the sharpest knife in the drawer, but I have my moments.

#### caballero

• Member
• Posts: 1043
##### Re: Caballero's drawer
« Reply #29 on: June 17, 2018, 05:00:12 AM »
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
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -