This is for for art experimentation:
We already play with the hsb command in one of the art lessons:
http://docs.google.com/Doc?id=dhgj3bkq_153cgq86cd2
Here is a seelogo program to experiment with it:
local h s b
h=0
s=100
b=100
solid hsb h s b [circle 200]
h ranges from 0 to 360 like the rainbow and s mean saturation (how much color) and b brightness (how much greyness).
In each comment we can put a different experiment with dynamic art
Subscribe to:
Post Comments (Atom)
7 comments:
Here is an experiment that changes color of the circle through all the rainbow colors:
The program is short enough so that you can be motivated to understand it.
local t h
t=0
loop 10000 [t=t+1/10000 h=360*t
solid hsb h 100 100 [circle 200]]
Copy and paste the program (type New E1 and paste it and press F9)
the idea is very simple but you need to get used to it. t is like "time" it changes from 0 to 1 (since I made it so by loop 10000 [t=t+1/10000]
and h=360*t so h ranges from 0 to 360. It is then simple!
Now look at the next post how to double the cycle h=2*360*t and also how to make the program longer (50000 instead of 10000)
Here is the second example
local t h
t=0
loop 50000 [t=t+1/50000 h=2*360*t
solid hsb h 100 100 [circle 200]]
I am fascinated by the simplicity and control. I hope you are motivated to understand it.
Remember the basic principle in ALL examples. t always goes from 0 to 1
loop 1000 [t=t+1/1000...
or
loop 20000 [t=t+1/20000... etc.
In this example the additional variable is
the x coordinate (we keep the y 0)
to achieve it we need to decide:
1. how to change the x coordinate.
I decided to make it x= 100 - 100*t
this means it will go from 100 to 0
2. What to draw? I decided just a small circle for now (circle 6)
so for now we have
local t x
t=0
loop 10000 [t=t+1/10000 x= 100 - 100*t
jt x 0 circle 6]
it uses the JT command you learned.
Now again, the program is short enough to motivate you to learn it.
The next comment we will change the circle 6 to something else. Say
spin 50 [fd 70 bk 70]
The old program was:
local t x
t=0
loop 10000 [t=t+1/10000 x= 100 - 100*t
jt x 0 circle 6]
do you see the simple change I made to circle 6
local t x
t=0
loop 10000 [t=t+1/10000 x= 100 - 100*t
jt x 0 spin 50 [fd 70 bk 70]]
In the next comment we will add color to it
Our first step is to make the program simpler to look at by putting the
FD 50 Bk 50 on one line alone
local t x
t=0
loop 10000 [t=t+1/10000 x= 100 - 100*t
jt x 0 spin 50 [
fd 70 bk 70
]
]
Then we add h (for hue) on the first line and decide on a period of say 3
h=3*360*t
and finall color with hsb the fd 70 bk 70
color hsb [fd 70 bk 70]
the end result is this:
local t x h
t=0
loop 10000 [t=t+1/10000 x= 100 - 100*t
h=3*360*t
jt x 0 spin 50 [
color hsb h 100 100 [fd 70 bk 70]
]
]
This result is already beautiful. Wait until you see the next one.
We are going to spin the picture 4 times
around the center of the screen. See Next comment
Now to accomplish this final task we use simply the Spin command.
The actual lines that draw the picture are:
jt x 0 spin 50 [
color hsb h 100 100 [fd 70 bk 70]
]
If we make sure that jt 0 0 is added after that and that spin 4 is added before that with the square brackets at the right place we will accomplish our task:
spin 4 [
jt x 0 spin 50 [
color hsb h 100 100 [fd 70 bk 70]
]
jt 0 0]
The complete result that only looks complicated is:
local t x h
t=0
loop 10000 [t=t+1/10000 x= 100 - 100*t
h=3*360*t
spin 4 [
jt x 0 spin 50 [
color hsb h 100 100 [fd 70 bk 70]
]
jt 0 0]
]
the story can go on forever we can use all the operators like size. etc. I am
pasting the last example on the next comment
local t x h s
t=0
loop 1000 [t=t+1/1000 x= 100 - 100*t
h=3*360*t s= 1+2*t
size s [
spin 12 [
jt x 0 spin 50 [
color hsb h 100 100 [fd 70 bk 70]
]
jt 0 0]
]
]
Post a Comment