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

#### caballero

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

The flag effect is a nice exercise, easier to say than to do
The logic of the error is hidden among the most unexpected lines of the program

#### Siekmanski

• Member
• Posts: 2253
##### 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 )

Creative coders use backward thinking techniques as a strategy.

#### caballero

• Member
• Posts: 1450
• Matrix - Noah
##### 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?
The logic of the error is hidden among the most unexpected lines of the program

#### Siekmanski

• Member
• Posts: 2253
##### 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 a strategy.

#### caballero

• Member
• Posts: 1450
• Matrix - Noah
##### 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  :t
The logic of the error is hidden among the most unexpected lines of the program

#### Siekmanski

• Member
• Posts: 2253
##### Re: Caballero's drawer
« Reply #20 on: June 03, 2018, 09:15:35 PM »
: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.

#### caballero

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

I'm trying to do the filling of regions for the quadrilaterals
The logic of the error is hidden among the most unexpected lines of the program

#### caballero

• Member
• Posts: 1450
• Matrix - Noah
##### 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
The logic of the error is hidden among the most unexpected lines of the program

#### felipe

• Member
• Posts: 1323
• 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.  :icon14:
Btw, this flag seems to say GOOOOAAAALLLL!!!!!!  :icon_mrgreen:
Felipe.

#### daydreamer

• Member
• Posts: 1311
• building nextdoor
##### Re: Caballero's drawer
« Reply #24 on: June 04, 2018, 03:15:24 AM »
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

Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

#### Siekmanski

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

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

#### caballero

• Member
• Posts: 1450
• Matrix - Noah
##### Re: Caballero's drawer
« Reply #26 on: June 05, 2018, 04:00:40 AM »
Yes, a palette according to the sine wave
The logic of the error is hidden among the most unexpected lines of the program

#### daydreamer

• Member
• Posts: 1311
• building nextdoor
##### 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*
Gone serverside programming p:  :D
I love assembly,because its legal to write
princess:lea eax,luke
:)

#### zedd151

• Member
• Posts: 871
##### 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.   :P
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

#### caballero

• Member
• Posts: 1450
• Matrix - Noah
##### 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
The logic of the error is hidden among the most unexpected lines of the program