Skip to content

Instantly share code, notes, and snippets.

@jamesmichiemo
Created August 7, 2019 16:02
Show Gist options
  • Select an option

  • Save jamesmichiemo/3a59773986bab0768832362b84b0ca2c to your computer and use it in GitHub Desktop.

Select an option

Save jamesmichiemo/3a59773986bab0768832362b84b0ca2c to your computer and use it in GitHub Desktop.
processing + propane sketch
/usr/bin/env jruby
# frozen_string_literal: false
require 'propane'
# map with the map function
# propane graffiti by 8mana
# based on code by Casey Reas and Ben Fry
class MapFunction < Propane::App
def settings
size 240, 120
end
def setup
sketch_title 'map values to a range'
strokeWeight 12
end
def draw
background 204
stroke 255
line 120, 60, mouseX, mouseY
stroke 0
mx = p5map mouseX, 0, width, 60, 180
line 120, 60, mx, mouseY
end
end
MapFunction.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment