Something for Halloween
#21
Hi Donald, 

Oh, you are worried about the SIN function, I bet. Don't worry.

SIN(anything) keeps a number between  -1 and 1, it goes up and down between -1 and 1 cycles of 2*pi = 6.28....

So it is used here to make micro changes to color one of the R, G, B color values of _RGB(R, G, B)

Each of R, G, B has a range of  0 to 255,    255 = 127 + 127

now if we multiply 127 * sin(x),  we get numbers from -127 to 127

add that to 127 and then we get numbers from 0 to 254 which is the range used for each of R G B.

In summary, SIN is used here to keep each color value of RGB between 0 and 254, 

That's it for SIN (for today).  No matter what number you feed a SIN function, it will always kick out a number between -1 and 1. That is all we used it for in this demo.
B += x
Reply
#22
bplus,

 Your demo is amazing and it some time to try to understand how it works. I trying to understand how the color patterns change and direction change.

Donald
Reply
#23
(11-01-2017, 11:07 AM)Donald Foster Wrote: bplus,

 Your demo is amazing and it some time to try to understand how it works. I trying to understand how the color patterns change and direction change.

Donald

Oh man, don't waste your time there. That is the magic of using SIN or any? Trig function this way.

First make sure you understand how the letter shapes were made, that is crucial part of this demo and using technique in your programs.

OK, but you are fascinated with the question of patterns and colors and your mind won't let go of the question.
"Inquiring minds need to know!" same here when I first saw the effect.

I will make a demo to explain that part of the demo and ruin the magic of having wonder in your heart.

Oh wait, lets have a look at Google:
https://www.google.com/search?q=cabinet+...71&bih=669

Now I remember, Ribbons!

BTW Psychedelic Star Swirl.bas uses the same trick and its effect there blows my mind.

But it was Ribbons that I first studied the effect by copying it from a guy named PeterMaria who likely copied from someone else...
A version was already known at JB when I got there though Andy Amaya made inquiries about it at SdlBasic when I posted a study, which surprised the heck out of me. I mean I thought he would have seen it before.

Ribbons.bas now for QB64
http://www.thejoyfulprogrammer.com/qb64/...60#pid4970
B += x
Reply
#24
bplus,

Demo was very nice. I know you don't want me to jump ahead. So, back to how the letters are made. You scan the pixels of the phrase using point statement and save in an array the values determining if it's color which is part of the letter or 0 which is part of the back ground. You increase the size of the pixels using the line statement, which I would have never thought to use the line statement like that. Then you set up the loops to reproduce the phrase with larger pixels. o redrawing in black otherwise the color will be changed thought GetPlasma sub.

Donals
Reply
#25
Hi Donald, 

You are a quick study. Good summary, so good writer too!
B += x
Reply