Waiting rules artefact

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

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Waiting rules artefact

Post by lagroue »

Image

Don't use this kind of rules ! First they are totally meaningless, second it's cheating with limitations of the software ! :wink:

I mean : the black stripes appear only because I introduced a "wait" rule, which pause some rules, while others are running, and drawing.

Code: Select all

rule somerule { ... }
rule somerule 0.1 { wait { } } // pause

rule wait { wait { } }
rule wait 0.1 { somerule { } } // restart
The paused rules, when restarting, draw above the rules which didn't stop. Thus, the artefact.


BTW, The code for the worm above :

Code: Select all

startshape fear_worm

rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y 0.005 s 0.98 b 0.005 }
}
rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y 0.000 s 0.97 b 0.03 }
}

rule fear_worm {
	fear_circle { s 0.1 }
	fear_worm { x 0.01 r 4.42 s 0.99}
}

// pause mechanism

rule fear_worm 0.05 { wait_worm { } }
rule wait_worm { wait_worm { } }
rule wait_worm 0.001 { fear_worm {  } }

User avatar
aaronstj
Posts: 66
Joined: Wed Jul 06, 2005 11:34 am
Location: Seattle

Post by aaronstj »

Wow, that's evil. And very clever. Or course, as soon as the "bug" is fixed, and overlapping drawing is made commutative and associative, it'll stop working. But until then, it's cool. I love the texture on the shell.

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post by lagroue »

This whole worm (shell, yeah you're right) is a big artefact, texture and black stripes... Like many samples of this forum.

I wonder if I really want this bug fixed ..... :twisted:

After that we'll be bound to think mathematically. Developpers, could we have, in this future version, a "amateur" checkbox in the preferences so that we can choose good old pretty rendering mode ? :wink:

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

Post by MtnViewJohn »

You bet. I actually like the order dependent nature of the current color model. It might be better to put this into the CFDG file itself.

User avatar
aaronstj
Posts: 66
Joined: Wed Jul 06, 2005 11:34 am
Location: Seattle

Post by aaronstj »

Speaking of color models, any idea when we're going to get color? I saw that the online version (which I can't find right now) had color, using the HSB model, which I think should work well. Another idea is to use a simple color map, like Fractint uses to color things.

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

Post by MtnViewJohn »

We are trying to prioritize features. There seems to be a lot of interest in animating the output. We should put up a poll to see what people want to see first.

User avatar
aaronstj
Posts: 66
Joined: Wed Jul 06, 2005 11:34 am
Location: Seattle

Post by aaronstj »

MtnViewJohn wrote:We should put up a poll to see what people want to see first.
You should indeed. I'm much more interested in colors than animation.

Of course, I could just get hte source and add color myself....

User avatar
chris
Site Admin
Posts: 72
Joined: Wed May 04, 2005 10:57 am
Location: New York, NY
Contact:

Post by chris »

PHP version
http://korsh.com/cfdg/

I'm a pretty big fan of this site...I haven't taken the time to learn his additions to the language, but it clearly LOOKs awesome.

I feel pretty strongly about being careful about any language additions, though. Mark and John seem to be the same way.

(this post should probably be moved to the other board)

One of the biggest things to resolve before dealing with opacity, stretching, flipping, colors, etc is how shapes are prioritized for drawing. i.e., a CFDG programmer (all of us who use it) should have a good idea of what will end up on top of what.

Currently nonterminal shapes are stored in a queue. On a nonterminal replacement it's pulled off the front and thrown on the back. On a terminal replacement it's thrown in the front of the drawing queue.

So basically the ordering is determined by how nested it was.

One complication comes when temp files are written. It obviously gets difficult to truly maintain a queue... I'm not sure what Mark and John's versions do for this. On my original implementation predictable sorting fell apart. As soon as you had temp files shit got stacked in weird ways.

This never mattered when all we had was black! Or with trees where branches crossed randomly.

cc
Current Project: I'm creative director of OKCUPID at http://www.okcupid.com

User avatar
aaronstj
Posts: 66
Joined: Wed Jul 06, 2005 11:34 am
Location: Seattle

Post by aaronstj »

(I agree this discussion should be moved. I'm going to post a reply to your last post to Feature Discussion)

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post by lagroue »

A variation on the same stuff : a horrible pet

Image

Code: Select all

startshape fear_worm

rule fear_worm { fear_worm1 { } }
rule fear_worm { fear_worm2 { } }
rule fear_worm 0.1 {
	antenna { s 0.01 y 0.02 }
	antenna { s 0.01 r 20 y 0.02 }
}


rule fear_worm1 {
	fear_circle { s 0.1 b 1}
	fear_worm1 { x 0.03 r 4.42 s 0.995}
}

rule fear_worm2 {
	fear_circle { s 0.1 b 1}
	fear_worm2 { x 0.02 r -4.42 s 0.995}
}

rule fear_worm1 0.3 {
	fear_worm { }
}

rule fear_worm2 0.3 {
	fear_worm { }
}

rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y -0.005 s 0.98 0.998 b -0.005 }
}
rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y -0.000 s 0.97 0.998 b -0.05 }
}

rule antenna {
	CIRCLE { }
	antenna { x 1 r 10 s 0.8}
}

User avatar
chris
Site Admin
Posts: 72
Joined: Wed May 04, 2005 10:57 am
Location: New York, NY
Contact:

Post by chris »

That caterpillar is sooooooo coool. It looks soft and squishy!
Current Project: I'm creative director of OKCUPID at http://www.okcupid.com

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post by lagroue »

Even more disgusting

Image

Image

Code: Select all

startshape fear_worm

rule fear_worm { fear_worm1 { } }
rule fear_worm { fear_worm2 { } }
rule fear_worm 0.1 {
	antenna { s 0.01 y 0.02 }
	antenna { s 0.01 r 20 y 0.02 }
}


rule fear_worm1 {
	fear_circle { s 0.1 b 1}
	fear_circle { s 0.1 b 1 r 10}
	fear_worm1 { x 0.03 r 4.42 s 0.995}
}

rule fear_worm2 {
	fear_circle { s 0.1 b 1}
	fear_circle { s 0.1 b 1 r 10}
	fear_worm2 { x 0.02 r -4.42 s 0.995}
}

rule fear_worm1 0.3 {
	fear_worm { }
}

rule fear_worm2 0.3 {
	fear_worm { }
}

rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y -0.005 s 0.98 0.998 b -0.005 }
}
rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y -0.000 s 0.97 0.998 b -0.05 }
}

rule antenna {
	CIRCLE { }
	antenna { x 1 r 10 s 0.8}
}

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post by lagroue »

chris wrote:It looks soft and squishy!
Thanks Chris : you see, your software can also produce obnoxious stuff ! :wink:

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post by lagroue »

Image

I'm found of my caterpillars...

Code: Select all

startshape fear_worm

rule fear_worm { fear_worm1 { } }
rule fear_worm { fear_worm2 { } }
rule fear_worm 0.1 {
	antenna { s 0.01 y 0.02 }
	antenna { s 0.01 r 20 y 0.02 }
}


rule fear_worm1 {
	fear_circle { s 0.1 b 1 r -8 }
	fear_circle { s 0.1 b 1 r 8}
	fear_worm1 { x 0.01 r 4.42 s 1.005}
}

rule fear_worm2 {
	fear_circle { s 0.1 b 1}
	fear_circle { s 0.1 b 1 r 10}
	fear_worm2 { x 0.005 r -4.42 s 1.005}
}

rule fear_worm1 0.3 {
	fear_worm { }
}

rule fear_worm2 0.3 {
	fear_worm { }
}

rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y -0.005 s 0.98 0.998 r -2 b 0.001 }
}
rule fear_circle {
	CIRCLE { }
	fear_circle { x -0.005 y -0.000 s 0.97 0.998 r 2 b -0.05 }
}

rule antenna {
	CIRCLE { }
	antenna { x 1 r 10 s 0.8}
}

User avatar
LaT3x
Posts: 68
Joined: Wed Jul 06, 2005 3:11 pm
Location: Madrid, Spain

Post by LaT3x »

WOOOoooowwww
super reallistic!!! perfect job!

Post Reply