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

Friday, 9 October 2009

Seagulls

Playing with reflective like transformations in context free.

   1 startshape scene
   2 
   3 background{b 1 h 200 sat .7}
   4 
   5 rule scene{
   6 sun{z -1 y -.4}
   7 sea{x -1.5 y -1.5}
   8 beach{x -1.5 y -2.45}
   9 seagulls{s 0.2 y 2}
  10 }
  11 
  12 rule seagulls{
  13 bird{r 45 s .8}
  14 bird{r 45 y -5 x -4}
  15 bird{r 45 y 4 x 3 s .6}
  16 }
  17 
  18 rule bird{
  19 wing{}
  20 wing{r 90 flip 180}
  21 }
  22 
  23 rule wing {
  24 30*{y .5 s .9 r 5}CIRCLE{b 1 x .1}
  25 }
  26 
  27 rule sun {
  28 CIRCLE{b 1 h 60 sat .6}
  29 }
  30 
  31 rule sea{
  32 6*{x 1}{
  33 2*{y .47}SQUARE{h 220 sat 1 b 1}
  34 }
  35 sun_on_sea{s .58 x 1.49 y -.22}
  36 }
  37 
  38 rule beach{
  39 6*{x 1}{
  40 2*{y 1}SQUARE{h 60 sat 0.8 b 0.8}
  41 }
  42 }
  43 
  44 rule sun_on_sea{
  45 9*{y .37 s .87} 
  46 row{}
  47 }
  48 
  49 rule row{
  50 30*{x -.09}CIRCLE{b .8 sat .6 h 60}
  51 30*{x .09}CIRCLE{b .78 sat .6 h 60}
  52 }
  53 

Three birds in a beach scene, to get the sun behind the sea I used the z -1. The reflection type transformation is used to create the second wing (the combination of rotate and flip translations, puts me in mind of an OU maths course I took some years back):-


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