This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This example saves out two images of a star, | |
//a PNG (bitmap/raster) and a SVG (vector) | |
//SVG export: http://processing.org/reference/libraries/svg/ | |
import processing.svg.*; | |
size(300, 300); | |
//begin creating the SVG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// About turtle graphics: This program uses another way to think | |
// about moving through Processing's coordinate system. Instead of placing | |
// points on a grid, you can imagine yourself as being somewhere | |
// on the grid, facing a direction. You can move forward or turn. | |
// The drawn line follows behind you. | |
var loc; //current location | |
var orientation; //current orientation | |
var notch_height = 20; | |
var notch_width = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var circles; | |
var currentDragged; | |
var clickRadius = 50; | |
function setup() { | |
createCanvas(500, 500); | |
imageMode(CENTER); | |
circles = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var circles; | |
var currentDragged; | |
var clickRadius = 50; | |
function setup() { | |
createCanvas(500, 500); | |
imageMode(CENTER); | |
circles = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Exercises: | |
1. Change the nouns, verbs, adverbs to your own choice of words | |
2. Change the sentence structure (for example, add "and" and then a second clause) | |
3. Change the words to a different language (could be the one you are studying in | |
school right now). Change the sentence structure so that the sentences are grammatically | |
correct. | |
*/ | |
var nouns, verbs, adverbs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var color1, color2; | |
var gradientHeight = 300; //change this to change how far down the screen the gradient goes | |
function setup() { | |
createCanvas(800, 800); | |
color1 = color('#e67e22'); | |
color2 = color('#2ecc71'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
} | |
function draw() { | |
drawMouseCoordinates(); | |
} | |
function drawMouseCoordinates() { | |
push(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var color1, color2; | |
var colorToSelect = 0; | |
function setup() { | |
createCanvas(800, 800); | |
color1 = color(0, 0, 0); | |
color2 = color(0, 0, 0); | |
//draw some random colors in a grid | |
push(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// title : Paste Paper Comb Generator | |
// author : Natalie Freed | |
// license : MIT License | |
function getParameterDefinitions() { | |
return [{ name: 'w', type: 'float', initial: 10, caption: "Width :" }, | |
{ name: 'h', type: 'float', initial: 10, caption: "Height :" }, | |
{ name: 'rows', type: 'int', initial: 5, caption: "Rows :" }, | |
{ name: 'cols', type: 'int', initial: 5, caption: "Cols :" }, | |
{ name: 'thickness', type: 'float', initial: 3, caption: "Extrusion Thickness (3D mode):"}, |
NewerOlder