Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
CC Attribution NonCommercial ShareAlike
p5.func.js Simple Demo
Levin
xxxxxxxxxx
/*
* To add p5.func.js to an OpenProcessing sketch:
------------------------------------------------
* Go to this URL: https://raw.githubusercontent.com/IDMNYU/p5.js-func/master/lib/p5.func.js
* Download (Save-As) that file to your own computer; save it as p5.func.js
* In OpenProcessing, on the righthand side, click on the little sliders icon and open the "FILES" tab
* Upload the p5.func.js file by dragging it in to the FILES section
* Now go to the "SKETCH" tab in the OpenProcessing control panel
* Add a new Library (+) and then type this into the name field: p5.func.js
* Make sure the switch for that library is toggled ON (blue).
*/
let easeList;
let myEasingFunction;
function setup() {
createCanvas(256, 256);
easeList = new p5.Ease();
myEasingFunction = easeList["doubleExponentialSigmoid"];
}
function draw() {
background(200);
strokeWeight(2);
stroke(0);
noFill();
var parameter01 = map(mouseX, 0,256, 0,1);
beginShape();
for (var x=0; x<256; x++) {
var in01 = map(x, 0,255, 0,1);
var out01 = myEasingFunction(in01, parameter01, 0);
var y = map(out01, 0,1, 255,0);
vertex(x,y);
}
endShape();
}
See More Shortcuts
Please verify your email to comment
Verify Email