2020年6月20日 星期六

農場的英文是Farm還是Fram???Week18

出現了童年:鋼彈



程式如下:

PShape gundam;
void setup()
{
  size(500,500,P3D);
  gundam=loadShape("Gundam.obj");
}
void draw()
{
  scale(10,10,10);
  shape(gundam);
}

ps.讓他到中間去


程式如下:

PShape gundam;
void setup()
{
  size(500,500,P3D);
  gundam=loadShape("Gundam.obj");
}
void draw()
{
  translate(250,0,0);
  scale(10,10,10);
  shape(gundam);
}

完成!!!


程式如下:

PShape gundam;
void setup()
{
  size(500,500,P3D);
  gundam=loadShape("Gundam.obj");
}
void draw()
{
  background(128);                    /////清背景,不會有殘影
  translate(250,400,0);               //////讓他改位置
  scale(10,-10,10);                      //////先放大10倍,y變負
  rotateY(radians(frameCount));         //////旋轉技巧ps.旋轉的中心點在(0,0),先對Y軸做旋轉
  shape(gundam);
}

開始地球的環節


程式如下:

PImage img;
PShape globe;
void setup()
{
  size(300,300,P3D);
  img = loadImage("earth.jpg");
}
void draw()
{
  image(img,0,0);

ps.用個球體,之後要把地圖包上去


程式如下:

PImage img;
PShape globe;
void setup()
{
  size(300,300,P3D);
  img = loadImage("earth.jpg");
  globe = createShape(SPHERE, 100);
  
}
void draw()
{
  image(img,0,0);
  shape(globe);                          ///////它變成可改變的shape
}




程式如下:

PImage img;
PShape globe;
void setup()
{
  size(300,300,P3D);
  img = loadImage("earth.jpg");
  globe = createShape(SPHERE, 100);
  globe.setTexture(img);
  
}
void draw()
{
  //image(img,0,0);           
  shape(globe);
}


程式如下:

PImage img;
PShape globe;
void setup()
{
  size(300,300,P3D);
  img = loadImage("earth.jpg");
  globe = createShape(SPHERE, 100);
  globe.setTexture(img);
  
}
void draw()
{
  translate(width/2,height/2);
  shape(globe);
}


會旋轉了!!


程式如下:

PImage img;
PShape globe;
void setup(){
  size(300,300,P3D);
  img = loadImage("earth.jpg");
  globe = createShape(SPHERE, 100);
  globe.setStroke(false);
  globe.setTexture(img);
}
void draw(){
  background(128);
  translate(width/2,height/2);
  rotateY(radians(frameCount));
  shape(globe);
}





沒有留言:

張貼留言