a little help ...

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
Blu3
Posts: 4
Joined: Wed Nov 01, 2006 10:55 am
Location: New York, NY

a little help ...

Post by Blu3 »

here is the code that I was fiddling with:

Code: Select all

startshape foo

rule foo {
		SQUARE { }
		foo {y -1 s .999 r -.1}
}
..it gave me a curved line, but when I changed the size to 1 ...

Code: Select all

startshape foo

rule foo {
		SQUARE { }
		foo {y -1 s 1 r -.1}
}
it gave me a circle. why? And if I tell it not to rotate:

Code: Select all

startshape foo

rule foo {
		SQUARE { }
		foo {y -1 s 1}
}
it creates a line & then disappears. can someone explain to me what's going on?

User avatar
mtnviewmark
Site Admin
Posts: 81
Joined: Wed May 04, 2005 12:46 pm
Location: Mountain View, CA
Contact:

Post by mtnviewmark »

The first code is actually drawing part of a spiral. Change the size value to 0.99995 to see this. What is happening is each recursion of foo is drawn a little smaller, and so the distance ("y 1") on each recursion is a little less each time. As it curves, as it is going less each time, the curve makes an inward spiral.

The second example makes a circle as the size stays constant each recursion. So, the example draws a many many sided regular polygon. The example, as you no doubt know, recurses forever.

The last example draws an infinte line. Each recursion draws a square just south of the last. This keeps going forever. As the drawing progresses, you see the line get thinner and thinner as the camera "pulls back" to show you the ever expanding line. Eventually, the line is so thin there is nothing to draw. It is all less than 1/3 of a pixel. Hence, you don't see anything.
I'm the "m" in "mtree.cfdg"

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

Post by MtnViewJohn »

Blu3, is your avatar created in Context Free? It looks cool.

User avatar
Blu3
Posts: 4
Joined: Wed Nov 01, 2006 10:55 am
Location: New York, NY

Post by Blu3 »

Ok thanks, I thought I was doing something wrong.

I did create my avatar in Context Free, color & all ... I only wish that I could've made it bigger so you can see it a little better.

This program is great! :D

btw I have version 2.0beta v9, is that the latest version for windows?

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

Post by MtnViewJohn »

You should register on the cfdg gallery site and post your avatar design there.

2.0beta v9 is old. The latest release version is 2.0 v12. The latest beta version is 2.1beta. 2.1beta adds a tiling capability that allows you to create repeating cfdg images for desktop or web backgrounds of 3D object textures.

Post Reply