Learn creative coding writing simple programs
148. Drawing shapes with glow or shadow
By drawing the stroke of a shape multiple times with low opacity we can easily achieve glows and shadows. A simple concept that can produce good looking images. Here some examples: http://hamoid.tumblr.com/post/76579918775/84932-jpg-34758-jpg-and-49862-jpg-as-saved-by
Tip: the darkness of the shadow or glow should not decrease in a linear fashion (like 8, 6, 4, 2) or it will not look too real. That's why I used distances like 2*2, 3*3, 4*4 and 5*5. I'll try to record an episode in the future about linear vs exponential and other interesting curves. Meanwhile here you can find information about curves at: http://www.robertpenner.com/easing/
Code editor
You can make changes to the code below. Then
Reference
background
boolean
color
colorMode
draw
fill
float
for
height
if
int
loadShape
mousePressed
noFill
noStroke
popMatrix
println
PShape
pushMatrix
rectMode
rotate
setup
shape
size
stroke
strokeWeight
translate
void
width
background
boolean
color
colorMode
draw
fill
float
for
height
if
int
loadShape
mousePressed
noFill
noStroke
popMatrix
println
PShape
pushMatrix
rectMode
rotate
setup
shape
size
stroke
strokeWeight
translate
void
width
Try to stay close to the topic of this episode. Use the Processing forums for help with unrelated Processing projects (or hire me for help ;-)
To indicate that a word in your comment is code, use the `backtick`. Example
Do `float` and `int` smell similar?
To highlight code blocks, surround it with ``` code-fences ``` like this:``` void setup() { size(600, 600); } ```