Tutorial 02 — Processing Sketches

dare
Data Mining the City
1 min readSep 20, 2017
def setup():
size(200,200)
colorMode(RGB)
background(255, 255, 255)
def draw():
#defining the feature variables
eyeRadius = 5
eyeY = 80
eyeLeftX = 60
eyeRightX = 100
faceCenterX = 60
faceCenterY = 80
headRad = 100
mouthX1 = 60
mouthY = 100
mouthX2 = 90

#drawing the face
stroke(0, 0, 0)
fill(0, 0, 0)
ellipse(eyeLeftX,eyeY,eyeRadius,eyeRadius)
ellipse(eyeRightX,eyeY,eyeRadius,eyeRadius)
noFill()
ellipse(faceCenterX,faceCenterY,headRad,headRad)
line(mouthX1,mouthY,mouthX2,mouthY)
def setup():
size(200,150)
colorMode(RGB)
background(255, 255, 255)
def draw():
#defining the feature variables
face = {'eyeLeftX':60, 'eyeRightX': 100, 'eyeY':80,
'eyeRadius':5,'faceCenterX':60, 'faceCenterY':80,
'headRad':100,'mouthX1':60, 'mouthY1':97,
'mouthX2':90, 'mouthY2':100}

#drawing the face
stroke(255, 0, 255)
fill(255, 0, 255)
ellipse(face['eyeLeftX'],face['eyeY'],face['eyeRadius'],face['eyeRadius'])
ellipse(face['eyeRightX'],face['eyeY'],face['eyeRadius'],face['eyeRadius'])
noFill()
ellipse(face['faceCenterX'],face['faceCenterY'],face['headRad'],face['headRad'])
line(face['mouthX1'],face['mouthY1'],face['mouthX2'],face['mouthY2'])

--

--