Newbie Amazed!!

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
amazed
Posts: 3
Joined: Thu Sep 01, 2005 8:10 pm

Newbie Amazed!!

Post by amazed »

So far this is still WOW!!
I just found this program tonight and I don't even remember how I got here!!
For now I just have a couple questions, I think :D
When I save anything as a .png and open it in Paint Shop Pro 9 which supports transparent background of .png's, I still see the white background.
Anyway to remove it?

Can you point me somewhere so I can get the feel for adding color to the designs (if that's what you want to call the ones I played with)
I can find the color wheel but I don't get what it is for...?

Great program!!
I am sure I will be back and try grasp all this!
Thanks so much...

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

The default background is opaque white. You can change that by adding the line

Code: Select all

background { alpha -1 b -1 }
to change the background to transparent black.

Ummm... we have been meaning to write some documentation. Go to the gallery site and see some examples of how it is done. The color wheel is to help you pick the color you want and insert it into your cfdg file.

amazed
Posts: 3
Joined: Thu Sep 01, 2005 8:10 pm

Post by amazed »

Well I can tell I am mathematically defunked!!
But I already knew that...
Doesn't seem like I can get any code to work and I have no idea which part I am missing so I can't even ask for help about it!!

I have read almost every post in the forums, and the gallery.
Just when I think it is starting to make sense...it doesn't!!
I have even visited a few of the links posted fere to other sites that use something close to these codes, but yet are different.
Dose anyone know of a site which helps to understand this code a little better...

I tried the code for transparent black in one of the examples, I placed it right after the startshape line and nothing happened even when I clicked render...
Where does this go in the code line? Please....
LOL...would be great if the FAQ page had answers about the program not the forums..hehehe
Oh yeah and I read through the examples and tried playing with them also.

Bargonaut
Posts: 21
Joined: Wed Jul 27, 2005 1:28 pm

Post by Bargonaut »

Did you try the Lessons in the examples menu? They explain what each statement does to make the images.

The basic idea is that you have rules for each object to draw or how to move before repeating. The fun part is that if you have multiple rules with the same name, one is picked at random introducing lots of variations.

Using CF does assume you have a fair understanding of cartesian graphing, because you need to code the rules to translate (move) or rotate the objects around an imaginary grid. But, you can always start with an existing sample and change the parameters to see what happens.

Try this to see a really simple example:

Code: Select all

startshape go
background { alpha -0.5 b -1 }

rule go
{ 
  SQUARE{}
}
Have fun.
-Brad

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Context Free does not draw a checkered background to clue you in to transparency. It draws that background on top of white. This should be fixed.

amazed
Posts: 3
Joined: Thu Sep 01, 2005 8:10 pm

Post by amazed »

Thanks you guys!!
Somedays I could just smack my 7th grade math teacher for being such a jerk, apparently he didn't like the "Quote poor little rich girl" too much!!
All I have is a 8th grade math level (Basic Math)!!
I read through the lessons and even though I can kinda see what the code does to the images already there, I can't seem to take even a part of it that I think is the whole code and start to create a new image for myself....

For others coming on here who read these and don't even have a clue as to what the X & Y's do here is a link:
http://www.shodor.org/interactivate/act ... index.html
These little applets are great!!
http://www.shodor.org/interactivate/act ... index.html

Now I just need a graph for rotation values....Is that what the "r" does?

I am also wondering if we need to have UPPER CASE letters anywhere in particular? Like do the shapes (SQUARE) have to be in uppercase?

I have Version 1.2 v7.. and with the simple shape that Brad gave me I can change the numbers and that's what it it looks like is the { alpha -0.5 b -1 } does right is just drawn that black block on top of the white background right? But is that square in the center my start shape also?
Or is that just a back ground color?

Thanks for putting up with my beginner questions!!
But this is something that I want to learn as these drawing could and are such neat images that can be used as paint brushes in graphic programs (I use PSP9) and right now digital Scrapbooking is all the rage, and we use brushes!!
We can create images close to these using vector shapes and deforming them to suit our needs, but what fun to get a random image!!

Bargonaut
Posts: 21
Joined: Wed Jul 27, 2005 1:28 pm

Beginner help

Post by Bargonaut »

Here are a couple additions to the script, and you may see how it fits together.

Code: Select all

startshape go

rule go {
SQUARE{}
go { s 0.9 x 1 y 1 }
}
This script has one rule named "go", and it does two things.
1. Draws a square at the starting position
2. Calls the go rule again with a few changes: scale to 90% (0.9) of the size, draw at x+1 and y+1. That means the next square is drawn one block-size to the right (x+1) and up (y+1) from the last one.

The resulting image will be a diagonal line of squares that shrink as it moves towards the upper right of the picture.
Image

To introduce some randomness, you could add a second "go" rule, which would get called sometimes instead of the first rule:

Code: Select all

// add this after the previous "go" rule

rule go {
SQUARE {}
go { s 0.9 x -1 y 1 }
}
This version of "go" also does two things:
1. Draws a square
2. Calls go with different changes: now x-1 moves the square to the left.

Having two rules named "go" means CF will pick one randomly each time it needs to use one. So, sometimes the square will be to the right of the last one, and sometimes it will be to the left.
Image


If you wonder why you need to scale, it guarantees that the script won't run forever. By shrinking the size each time, eventually the square is too small to see, and CF won't bother to draw it.

BTW, you do need to write SQUARE in caps, since it is a special rule that draws a square.

Try adding other parameters when calling "go" from your rule. You could rotate a few degrees each time, so the squares turn bit by bit:

Code: Select all

rule go {
SQUARE {}
go { s 0.9 x 1 y 1 r 5 }
}
The "r 5" says to rotate 5 degrees before drawing the next square. That will make the squares turn as well as the imaginary grid. So, the x and y changes happen in the rotated grid, making curves instead of lines.
Image

For reference, rotation is in degrees. There are 360 degrees around a circle, starting at the 3 o'clock position (0 degress) and moving counter-clockwise. So, each number on a standard clock is 30 degrees (1/12th) around the circle from the last number.

Have fun!
-Brad

Post Reply