text 旋转fish.pde

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 旋转fish.pde相关的知识,希望对你有一定的参考价值。

PImage img1, img2, img3;
int rotationCount = 0;
int picSize;
static final color BG = -4;

void setup() {
  size(500, 500, P3D);
//  noSmooth();
//  ((PGraphicsOpenGL)g).textureSampling(2);
  img1 = loadImage("https://i.imgur.com/qNr33dN.png");
  imageMode(CENTER);                      
  picSize = height;
//  img1.resize(picSize, picSize);
//  img2.resize(picSize, picSize);
}

void draw() {
background(BG);
//background(0, 0);
picSize = height;
translate(width/2, height/2);

  pushMatrix();
rotate(radians(rotationCount));
  rotateY(radians(180));

  image(img1,0,0, picSize, picSize);
  popMatrix();
  
rotationCount++;
saveTransparentCanvas(BG, "img");

if (rotationCount == 360){
rotationCount = 0;
print("reached 360");
}

}

void saveTransparentCanvas(final color bg, final String name) {
  final PImage canvas = get(0,0,height,width);
  canvas.format = ARGB;
 
  final color p[] = canvas.pixels, bgt = bg & ~#000000;
  for (int i = 0; i != p.length; ++i)  if (p[i] == bg)  p[i] = bgt;
 
  canvas.updatePixels();
  canvas.save("Frame####"+frameCount+".png");
}

以上是关于text 旋转fish.pde的主要内容,如果未能解决你的问题,请参考以下文章

text 旋转空间junk.pde

text 随机放置旋转gloves.pde

text 旋转木马滑块

text 旋转木马模板

text 旋转圆x y grid.pde

text 使用Transform Rotate SCSS Mixin轻松旋转元素。只需一行SCSS,您的旋转元素将具有所需的静脉