p5js-cheat-sheet
p5js-cheat-sheet copied to clipboard
Ideation for Intermidiate worksheet
Use this space to discuss or list things that you think should be included on the intermediate worksheet
forloop & diagram radians / degrees chart events: mouseClicked(), mouseReleased(), keyPressed(), keyReleased() Image : loadImage() createImage() image() more math (+ conversion): floor() ceil() int() round() dist() constrain() more system variables: key, keyCode, keyIsPressed, mouseIsPressed, touches[] Tranform: translate() rotate() scale() push() pop() array definition ~~creating a class~~
maybe some DOM stuff?
.hide() createSlider()
function definition
I wonder if classes should be kicked down to "advanced" -- assuming the intermediate sheet is also a one-pager.
3D?
I agree that the classes should be on the advanced,
3D is tricky since there is just so much of it that's different. One approach I was thinking about would be to have a totally separate 3D sheet. So as of this count – 4 possible sheets that would be printed front / back: beginner/intermediate & advanced/3D
any thoughts on that idea?
Although not very intuitive, the functions sin() and cos() can be quite useful. It is difficult to summarize the possibilities in one or two lines, but maybe you can add at least the code that allows calculating the points around a center:
x = centerX + cos(angle) * radius;
y = centerY + sin(angle) * radius;
Alternatively, you could insert the code for conversions between polar and Cartesian coordinates:
x = cos(angle) * distance;
y = sin(angle) * distance;
distance = sqrt(x*x + y*y); // or distance = dist(0, 0, x, y);
angle = atan2(y, x) ;
But things would probably start to get too complicated for an intermediate worksheet.