Page 1 of 2

Waiting rules artefact

Posted: Thu Jul 07, 2005 11:44 pm
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 {  } }

Posted: Fri Jul 08, 2005 10:02 am
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.

Posted: Fri Jul 08, 2005 10:14 am
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:

Posted: Fri Jul 08, 2005 11:26 am
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.

Posted: Fri Jul 08, 2005 11:36 am
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.

Posted: Fri Jul 08, 2005 11:56 am
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.

Posted: Fri Jul 08, 2005 12:09 pm
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....

Posted: Fri Jul 08, 2005 12:34 pm
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

Posted: Fri Jul 08, 2005 1:08 pm
by aaronstj
(I agree this discussion should be moved. I'm going to post a reply to your last post to Feature Discussion)

Posted: Tue Jul 19, 2005 4:51 am
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}
}

Posted: Tue Jul 19, 2005 4:55 am
by chris
That caterpillar is sooooooo coool. It looks soft and squishy!

Posted: Tue Jul 19, 2005 5:02 am
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}
}

Posted: Tue Jul 19, 2005 5:10 am
by lagroue
chris wrote:It looks soft and squishy!
Thanks Chris : you see, your software can also produce obnoxious stuff ! :wink:

Posted: Tue Jul 19, 2005 5:26 am
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}
}

Posted: Tue Jul 19, 2005 7:38 am
by LaT3x
WOOOoooowwww
super reallistic!!! perfect job!