Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Saturday, 13 June 2009

I'm missing radians

It seems positevly old school to work in degrees, but that's how it seems to be in context free.
Really simple rotation example:-

 1
 2 startshape foo 
 3 background {sat 0.35}
 4 rule foo{
 5 box{ rotate 45 } 
 6 }
 7
 8 path box {
 9     MOVETO{x 0.5 y 0.5}
10     LINETO{x -0.5 y 0.5}
11     LINETO{x -0.5 y -0.5}
12     LINETO{x 0.5 y -0.5}
13     CLOSEPOLY{}     // go back to (0.5, 0.5) and close the path
14     STROKE{}        // draw a line on the path using the default line width (10%)
15 }


Easy peasy



Looks a bit similar to processings beginShape/endShape with a pile of vertices between. Useful command line options are -V required to specify svg output, -h and -w to specify height and width default is 500 x 500, -s sets both height and width -c will crop to size to image.

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2