แสดงบทความที่มีป้ายกำกับ Lab 1 แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Lab 1 แสดงบทความทั้งหมด

วันอาทิตย์ที่ 23 สิงหาคม พ.ศ. 2558

Lab1-GG



void setup(){
int posx=25;
int posy=7;
 size(500,550);
 background(#FFFFFF);
 rect(0, 0, 499, 549);
  //left heart
stroke(#000000);
strokeWeight(10);
 line(246-posx, 85-posy, 190-posx, 15-posy); //1
 line(190-posx, 15-posy, 90-posx, 130-posy); //2
 line(90-posx, 130-posy, 246-posx, 321-posy); //3
 line(246-posx, 321-posy, 246-posx, 150-posy); //4
 line(246-posx, 150-posy, 155-posx, 150-posy); //5
stroke(#F23383);
strokeWeight(7.5);
 line(246, 85, 190, 15); //1
 line(190, 15, 90, 130); //2
 line(90, 130, 246, 321); //3
 line(246, 321, 246, 150); //4
 line(246, 150, 155, 150); //5
 //right heart
stroke(#000000);
strokeWeight(10);
 line(262+posx, 85-posy,318+posx, 15-posy); //1
 line(318+posx, 15-posy, 418+posx, 130-posy);  //2
 line(418+posx, 130-posy, 262+posx, 321-posy); //3
 line(262+posx, 321-posy, 262+posx, 150-posy); //4
 line(262+posx, 150-posy, 353+posx, 150-posy); //5
stroke(#F23383);
strokeWeight(7.5);
  line(262, 85,318, 15); //1
 line(318, 15, 418, 130);  //2
 line(418, 130, 262, 321); //3
 line(262, 321, 262, 150); //4
 line(262, 150, 353, 150); //5
//Heart WAVE
strokeWeight(1);
 line(150, 370,185, 370);
 line(185, 370, 202, 344);
 line(202, 345, 202, 370);
 line(202, 370, 217, 344);
 line(217, 345, 217, 385);
 line(217, 385, 234, 357);
 line(234, 357, 244, 357);
 line(244, 357, 244, 370);
 line(244, 370, 259, 370);

 line(259, 370, 276, 344);
 line(276, 344, 276, 370);
 line(276, 370, 292, 344);
 line(292, 344, 292, 384);
 line(292, 384, 309, 357);
 line(309, 357, 319, 357);
 line(319, 357, 319, 370);
 line(319, 370, 354, 370);
 fill(#F23383);
 ellipse(354, 370, 3, 3);

    textSize(90);
    fill(#F23383);
    text("G",130,478);
    fill(#FFA5CB);
    textSize(40);
    text("irls",191,445);
    textSize(40);
    text("eneration",189,478);

  println("My faverite Music is ");
  print ("Girlsgeneration");
}

Lab1-ultranma



void setup(){
int posy=50;
  size(550,700);
  fill(#D8BABA);
  rect(0, 0, 549, 699);
  fill(#FFFFFF);
  rect(0, 0, 55, 699);
  textSize(40);
      fill(#000000);
     text("1",15,50);
      textSize(20);
      text("45B",8,660);
  fill(#FF9966);
  rect(60, 5, 485, 450);

  fill(#000000);
  strokeWeight(4);

  ellipse(300, posy+250, 240, 250);//face back
  fill(#FFFFFF);
  rect(165, posy+251, 30, 40);//left ear
  rect(405, posy+251, 30, 40);//right ear
  ellipse(300, posy+254, 238, 245);
  fill(#FDFF40);//face front
     ellipse(360, posy+245, 70, 80);//right eye
     ellipse(240, posy+245, 70, 80);//left eye
  strokeWeight(2);
  fill(#000000);
   triangle(300, posy+275, 285, 100, 315, 100);  //crest
  textSize(70);
      fill(#000000);
     text("The",100,530);
      textSize(60);
     text("Ultraman",250,530);
      textSize(40);
     text("Original",380,580);
 
  println("My faverite book is ");
  print ("ultranma");

}

Lab1 - joker



void setup(){
int posx=50;
 size(600, 600);
 background(#778899);
  fill(#FAEBD7);
  strokeWeight(5);
   ellipse(300, 300, 300, 400); //face

 stroke(#000000);
 strokeWeight(5);
  line(300, 98, 300,  50); //hair 1
  line(295, 98, 280,  60); //hair 2
  line(305, 98, 320,  60); //hair 3


   //Nose
  fill(#CC0000);
  strokeWeight(5);
   ellipse(posx+300, 350, 70, 65); //nose
  fill(#FF0000);
  stroke(#FF0000);
  strokeWeight(1);
   ellipse(posx+303, 350, 59, 55); //nose red
  fill(#FF4500);
  stroke(#FF4500);
  strokeWeight(1);
   ellipse(posx+306, 350, 48, 45); //nose orange
  fill(#FFA500);
  stroke(#FFA500);
  strokeWeight(1);
   ellipse(posx+309, 350, 37, 35); //nose yellow
 
 
  fill(#000000);
  stroke(#000000);
   quad(posx+210, 250, posx+230, 200, posx+250, 250, posx+230, 300); //left tatto
 
  fill(#F8F8FF);
  strokeWeight(2);
   ellipse(posx+230, 250, 80, 30); //left eye
   ellipse(posx+370, 250, 80, 30); //right eye
   fill(#CC0000);
   stroke(#CC0000);
   strokeWeight(1);
    ellipse(posx+230, 250, 10, 26); //left small eye
    ellipse(posx+370, 250, 10, 26); //right small eye
    fill(#FF0000);
    stroke(#FF0000);
    strokeWeight(1);
     ellipse(posx+230, 250, 2, 2); //left very small eye
     ellipse(posx+370, 250, 2, 2); //right very small eye
   
   println("My Movie is Batman");
   print("This is JOKER");
}

Lab1-BMI




void setup(){
float BMI;//Body mass index
float weight;
float hight;
  size(600,100);

  weight = 84;
  hight = 184;
  hight = hight/100;
  BMI=weight/(hight*hight);

 println("Weight = "+weight);
 print("Hight = ");
 println(hight);
 println("BMI = "+BMI);
 fill(#2F640C);
 textSize(40);
 text("BMI is "+BMI,100,50);
}

วันจันทร์ที่ 17 สิงหาคม พ.ศ. 2558

Lab-Circle




void setup(){
float c;//Circrumference
float d;//Diameter of the circle
float r;//radiuns
float a;//area
  size(620,120);
  println("Circumference of a Circle");
  println("Method C=Pi*d ");
  d=10;
  c=PI*d;
  r=d/2;
  println("r is "+r);//print Diameter
  println("d is "+d);//print Diameter
  println("Pi is "+PI);// Pi=3.1415927
  println("C is "+c);

  a=PI*(r*r);
  println("A is "+a);
  fill(#690181);
  textSize(40);
  text("circumference is "+c,20,50);
  text("Area is "+a,20,100);
}

Lab1-Battery


void setup(){
 size(600,450);
 background(#EAE49C);
 fill(#EAE49C);
 stroke(#384D12);
 strokeWeight(5);
 rect(220, 175, 200, 75, 7); //case
 fill(#384D12);
 //depolarized
 rect(210, 190, 10, 45, 2);
 //in case
 rect(392, 184, 19, 58, 1);
 triangle(389, 188, 389, 242, 345, 242);
 

}

วันอาทิตย์ที่ 16 สิงหาคม พ.ศ. 2558

Lab1-Positive sign



void setup(){
int pos=100;
 size(500,500);
 background(#000000);
 fill(#ED0C0C);
 stroke(#ED0C0C);
 rect(100, pos+100, 300, 100);
 rect(pos+100, 100, 100, 300);
}