[Processing] Small code 4

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.