Translate(X, y); move the coordinate origin to X, Y
Rotate(Angle); coordinates rotate angle degrees clockwise along the origin
Scale(N); draw an image to zoom in n times
Pushmatrix() Press the current coordinate into the stack
Popmatrix() Stack coordinates
--------------------------------------
In Windows, p3d always reports an error. During the check, the previously written items are lost. For Linux, it can be displayed, but smooth () cannot be used, saying that my hardware does not support it. In addition, the code written in Linux cannot be copied. paste a picture to make it happen.
The two squares are converted along different coordinates.
Bytes -------------------------------------------------------------------------------------
Millis(): Millisecond
Second() Seconds
Minute() Points
Hour() Hour
void setup(){ size(300,300);}void draw(){ background(0); int ms = millis(); int s = second(); int m = minute(); int h = hour(); fill(255,0,0,100); rect(ms/100,0,30,70); fill(0,255,0,100); rect(s*2,75,30,70); fill(0,0,255,100); rect(m,150,30,70); fill(0,255,255,100); rect(h,225,30,70);}
The four small rectangles are moved by time.
------------------------------------------------------
Define a function: Same as the C Language
-----------------------------------------------------
Definition class:
Class Name{Variable;Name (...) {...} // ConstructorFunction 1;Function 2;...}----------------------------------------------------------------
Array: similar to C ++
Int [] Number = new int [6];
[Processing] Small code 4