8/9/12

Characters: the Magical Button


The button is used in the animation part to get access to the next section. Also in the magic mirror part to finish the test choices.

The design is an animation flower which can cause attention and fill with magic. The coding was inspired by a sakura in OpenProcessing, which use offset to simulate a flower.


for (float a = 0; a <= 360; a += 45){
  for(int i = 0; i < 8; i++){
  float f = radians (a+offset+i * 4f);
  float h = radians (b+i * 0.2f);
  noStroke();
    
  float alf = 255f/8f * (float)i;
  fill(c1,c2,c3, alf);
  float x = posX - 30 + cos (f) * (15 + sin (b+i * 0.2f)*20);
  float y = posY - 20 + sin (f) * (15 + sin (b+i * 0.2f)*20);
  ellipse (x, y, abs(sin (b+i * 0.2f)*10), abs(sin (b+i * 0.2f)*10));
  //fill(231-(cos(b)*60), 131, 109);
  }
  }

  b += 0.2;
  offset += 4;

Reference:
1. Openprocessing,桜 byAnastasis Chasandras http://www.openprocessing.org/sketch/10413

No comments:

Post a Comment