CS labs have computers which can run these. If you want an account, see the syllabus.
https://processing-app.org/
If you have an iPhone or an iPad, you can use the Processing app. It runs sketches on your device (not in the cloud!)
Very slightly different rules, but enough to cause errors: check your file on the main version of processing before submitting!
Field | Project |
---|---|
Geospatial Imaging | Parallelization of Random Forests for Tree Carbon Estimation |
Consumer Medical | Machine learning-based pill identification algorithm |
Sociology | Simulation of collaboration and productivity in academia |
HPC Systems | Bitflip error tolerance in high-performance parallel computing |
Computational Bio | Flexible Protein Docking + Folding |
Medical Imaging | Virtual surgery and reconstruction of injured pediatric skulls |
Public Policy | Acceleration of agent-based simulation for COVID-19 |
Compiler Design | Reverse compilation of PTX for custom GPU architectures |
Chemistry | Optimal representations for polymer storage |
Languages represented in these projects:
Only knowing one language and not being able to pick up a new one will severely limit the kinds of things you can work on.
School is a great place to practice learning new things!
Not just a toy language---can be used for heavy tasks!
Is somewhat specialized.
void setup(){
// This is a comment!
int win_edge = 600;
size(win_edge, win_edge);
}
void draw(){
ellipse(250,200,200,200);
rect(250, 200, 150, 100);
}
Can you name similarities to Python?
Can you name differences to Python?
void setup()
and void draw()
functions. Look on the Processing website to see some of the available callsprintln()
to print your variable to the console.setup()
and draw()
functions.Processing always expects a sketch named "my_sketch.pde" to be contained within a directory called "my_sketch".
If you don't, it'll nag you every single time you open the file.
Probably easier just to get used to making an independent folder for each Processing program you write in this class. You will need to do this later anyways to allow for use of multiple classes and data files.
Also makes me grumpy when I have to click this notification 50 times every day when trying to grade hand-on.
Not these!
Canvas "helpfully" renames submission files to make it easier to see what the submission is, but this often breaks the naming rules for Processing files.
Canvas can rename the ZIP file but it won't rename things inside of it!
Assignments not submitted in this format may have points deducted.
// var-type name = value ;
int x = 7;
/*
return-type name(arg-type arg-name*){
< function body >
}
*/
int addTwo(int x){
return x + 2;
}
void setup(){
size(600, 600);
}
void draw(){
ellipse(250,200,200,200);
rect(250, 200, 150, 100);
}
Code inside setup()
runs once
Code inside draw()
runs in a continuous loop
Combined, these act a little like main()
int x = 0;
void setup()
{
x = 2;
int y = 7;
}
void draw()
{
x++; // Okay, x is visible here
y += 2; // Not okay, y is out of scope
}
x
y
y
x
The same point can have different coordinates in different coordinate systems!
World Coordinate System
Camera Coordinate System
Object Coordinate System
You will sometimes hear these referred to as "spaces", e.g. "world space" or "screen space". You can think of "X space" as meaning "within the X coordinate system."
Like text!
Specify a pixel within the window
Define a line between \((x1,y1)\) and \((x2, y2)\)
triangle(x1,y1,x2,y2,x3,y3)
rect(a,b,c,d)
ellipse(a,b,c,d)
quad(x1,y1,x2,y2,x3,y3,x4,y4)
arc(a,b,c,d,start,stop)
bezier(x1,y1,x2,y2,x3,y3,x4,y4)
point
, line
, rect
, ellipse
, triangle
, and quad
methods at least two times eacharc
methodbezier
methodbezier
challenging to work directly with in code?/* Java lets you write block
comments like this */
Remember to submit in ZIP format we discussed!
We will usually do this towards the end of class.
Write the following information: