Context Free Design Grammars for POV-Ray

ContextFree is a kickass free program for rendering fractal-like images from context free design grammars. I've been playing wiht it a lot recently and wanted to do something simmilar in 3d using POV-Ray. This is the first beta version of a script to do that. The language is not fully supported yet and there is some new stuff I'd like to add. Bug reports, comments, and images to my gmail address, I'd love to see what you make with this thing :-)

[Download source code]

rules go here:

instructions

This program is meant as a 3d approximation of the excellent Context Free renderer, so you'll need to learn to use that first. The syntax for myCFDG3d is mostly the same, except that r (rotate) becomes rx and ry to rotate on the x and y axes, and objects can now also be transformed on the z axis. CIRCLE becomes SPHERE, SQUARE becomes CUBE and I've added a new shape, CYLINDER. No TRIANGLE as yet, flip and looping not yet supported.

TODO

  • Check the math for object-space rotation, I think there may be a bug there.
  • Support more shapes, and user-defined shapes.
  • Support HSL color, alpha blending, as with Context Free.
  • Think about implementing transparency, refection, textures and other POV-Ray stuff.
  • If there is interest, add a user gallery, as at chriscoyne.com

Ideas

Add rand(min - max) as an option for variables, as in:

somerule {y 1, z rand(3, 10), rx rand(20, 50) }

Terminating cases - allow rule definitions reference another rule to switch to once object space reaches a certain size, eg:

rule STALK 100 terminate 0.3 FLOWER { CIRCLE {} STALK {y 1, rx 1, size 0.97 } }

In this case STALK behaves normally until object space becomes 0.3 the size of world space, then FLOWER is called in its place. Not quite context free.

Limitations

This copy of the program only runs to four thousand iterations. I know that's not lot. Generating million line text documents, several at a time, would affect the other sites running off this server. Ideally the server would also render the POV-Ray script to an image, for this heavily loaded box it's too expensive in memory and CPU time. If you can host a mirror with higher spec, please let me know an I'll link you from the front page. Thanks :-)




Example

context free design grammars with povray startshape tree

rule tree {
      branch { ry 30, rx 30 }
      branch { ry -30, rx -30 }
      branch { ry -30, rx 30 }
      branch { ry 30, rx -30 }
}

rule branch 10 {
      CIRCLE {}
      branch { y 1, ry -5, size 0.95 }
}

rule branch 10 {
      CIRCLE {}
      branch { y 1, ry 5, size 0.95 }
}

rule branch {
      CIRCLE {}
      branch { rx 20, size 0.95 }
      branch { rx -20, size 0.95 }
}

rule branch {
      CIRCLE {}
      branch { ry 20, size 0.95 }
      branch { ry -20, size 0.95 }
}


Webcams

82.92.129.195 - Axis 207.63.1.145 - Panasonic KX Series 163.136.136.20:8184 - Panasonic KX Series 198.189.234.13 - Axis 210.172.213.198 - Panasonic KX Series 87.52.123.34 - Axis ioctync1.city.miyazaki.miyazaki.jp - Panasonic KX Series 219.111.32.138:8081 - Panasonic KX Series 65.74.44.104:82 - Panasonic KX Series 210.167.182.127 - Axis 82.68.218.214:50002 - Axis 137.44.28.240 - Axis 210.162.246.118 - Panasonic KX Series 131.188.69.22 - Axis

Toys

Ransom Notes
Stencil Maker
Mix Poetry
Sarcasmotron
Shocked Robin
Jailbaiting
Google Adult
Yahoo Adult
Context Free
Google Video
myCFDG3d
Hotlink Lottery

Popular Posts

The BBC iPlayer
Christian Nudist Camp
Hacking iFriends
iFriends GreaseMonkey Script
A Higher Art, Nude Ballet
BBC Documentaries as Torrents
Hacking Dating Websites
Assvertising
Golf GTI Scale-Electric Flash Game
Marmaduke is Watching You Masturbate

Recent Posts

Calling all Junior Scientists
Golf GTI Scale-Electric Flash Game
Obama Cuts Funding For Abstinence Only Sex Ed
Pictures from the Moscow Gas Pipeline Fire
Sea Monster in the English Channel
Give Him Bacon
The Moar You Know
A Song to Ride Ducks By
New York Became My Canvas
How I Wonder Is A Cat

Categories


hacking
internet
introspection
music
photography
stuff
stupid
things
webcomic

- (Made By Machines) -