手绘和码绘两种方式创作“运动”主题

艺术的展现形式有多种多样,绘画的方式也有很多。这篇文章主要来比较一下手绘与码绘。

什么是码绘?用编程语言即代码来画画。一般人更多接触到的是手绘,只有从事或研究相关方面的才会比较了解码绘。听说现在的艺术生都要学点编程呢。

上面两张就是用processing作的动态图和静态图,是不是觉得神奇又有趣呢。深入了解才能知道码绘中的奥秘。

码绘一般用processing,p5.js。processing是一个互动编程软件,java语言发展而来。而且动画效果是跑在processing专门的模拟器上。 接下来展示用processing编写烟花特效。


完整代码

ArrayList<Fireworks> fireworks=new ArrayList<Fireworks>();           

void setup () {
  fullScreen(P3D); //全屏显示
  frameRate(50); 
  hint(DISABLE_DEPTH_TEST);
  blendMode(ADD);
  imageMode(CENTER);
}

void draw () {
  background(0,0,40);
  for(int i=0;i<fireworks.size();i++){
     Fireworks art=fireworks.get(i);
     if(art.centerPosition.y-art.radius>height){
       fireworks.remove(i);
     }
     art.display();
     art.update();
   }
}

void keyPressed(){ //按下空格产生烟花
  fireworks.add(new Fireworks(80));//80为烟花初始半径
}


PImage createLight(float rPower,float gPower,float bPower){
  int side=64;
  float center=side/2.0;

  PImage img=createImage(side,side,RGB);

  for(int y=0;y<side;y++){
    for(int x=0;x<side;x++){
      float distance=(sq(center-x)+sq(center-y))/10.0;
      int r=int((255*rPower)/distance);
      int g=int((255*gPower)/distance);
      int b=int((255*bPower)/distance);
      img.pixels[x+y*side]=color(r,g,b);
    }
  }
  return img;
}

//烟花
class Fireworks{
  //烟花的数量
  int num=512;
  //烟花中心的初期位置
  PVector centerPosition=new 
  PVector(random(width/8,width*7/8),random(height/2,height*4/5),random(-100,100));
  //烟花中心的初始速度
  PVector velocity=new PVector(0,-22,0);
  //重力
  PVector accel=new PVector(0,0.4,0);
  PImage img;

  float radius;

  PVector[] firePosition=new PVector[num];


  Fireworks(float r){
    float cosTheta;
    float sinTheta;
    float phi;
    float colorchange=random(0,5);

    radius=r;
    for (int i=0;i<num;i++){
      cosTheta = random(0,1) * 2 - 1;
      sinTheta = sqrt(1- cosTheta*cosTheta);
      phi = random(0,1) * 2 * PI;
      firePosition[i]=new PVector(radius * sinTheta * cos(phi),radius * sinTheta * sin(phi),radius * cosTheta);
      firePosition[i]=PVector.mult(firePosition[i],1.12);
    }
    //调整烟花随机颜色,使其更亮丽
    if(colorchange>=3.8){
      img=createLight(0.9,random(0.2,0.5),random(0.2,0.5));
    }else if(colorchange>3.2){
      img=createLight(random(0.2,0.5),0.9,random(0.2,0.5));
    }else if(colorchange>2){
      img=createLight(random(0.2,0.5),random(0.2,0.5),0.9);
    } else {
      img=createLight(random(0.5,0.8),random(0.5,0.8),random(0.5,0.8));
    }
  }

  void display(){
    for (int i=0;i<num;i++){
      pushMatrix();
      translate(centerPosition.x,centerPosition.y,centerPosition.z);
      translate(firePosition[i].x,firePosition[i].y,firePosition[i].z);
      image(img,0,0);
      popMatrix();

      firePosition[i]=PVector.mult(firePosition[i],1.015);
    }
  }

  void update(){
    radius=dist(0,0,0,firePosition[0].x,firePosition[0].y,firePosition[0].z);
    centerPosition.add(velocity);
    velocity.add(accel);
  }
}

效果图如下:

还是很美丽酷炫的!

然后是我的烟花手绘:

画的不是很细致,毕竟技术生hhh.......


下面从不同角度来比较手绘与码绘的特点

工具:手绘是用画笔,可以用真正的画笔,或者电脑上的绘画软件中的画笔,当然电脑的画笔不太好操控;

           码绘是用编程软件,我用 的是processing;

技巧:手绘需要扎实的绘画技巧,就比如速写课上 所学的,不一定每一笔都画到位,学会取舍,让画面看起来更加完整美观;

            码绘需要一定的编程技能,网上有很多资料网站可供学习,如processing的http://iprocessing.cn/的中文学习网站就很不错

创作体验:

            手绘创作就很轻松啊,可以发挥你的想象随意创作,不一定要画的特别像,只要能表达出自己的想法我觉得就可以了,如果只是作为课外兴趣的话。

             码绘就没想象中那么简单了。要考虑画中对象的线条,位置是否到位,不然机器才不管你想画什么,只会跟着代码 走。码绘前要整理好创作思路,有些还需要一些特效来处理。需要对相应编程语言的学习与研究。

呈现效果:手绘通过画笔的的创作,如果绘画基础扎实,那么应该能比较直观的表现出东西。当然,如果要实现“动态”效果,那 就需要良好的绘画技巧,抓取动态中的一个场景,由静生动,从静态图中给人会动的视觉效果。

                    码绘通过一定的编程技巧还是可以展现出比较酷炫的效果的,网上就有很多码绘的有趣的栗子,可自行搜索查看啊。

局限性:手绘比较活泼,所以很难创作那种的非常规范庞大的作品,即使要画也是比较复杂费力的,而码绘编辑好代码就可以一                   键生成啊。相对的,码绘比较死板,不能随意表现出一些深刻的含义。

应用: 手绘的应用还是很常见的,画家通过作品向世人表达情感嘛。码绘对艺术生的艺术创作也是很有用的,一些设计师就需                 要用电脑工具来更方便的设计作品。

这篇的动态手绘&码绘的比较分析就到这吧。。。

参考资料链接:

0.1 用代码画画——搞艺术的学编程有啥用? https://blog.csdn.net/magicbrushlv/article/details/77922119 1.1 开始第一幅“码绘”——以编程作画的基本方法 https://blog.csdn.net/magicbrushlv/article/details/77840565

https://qiita.com/mikittt/items/776e6f2a114866386b54

http://iprocessing.cn/

https://blog.csdn.net/magicbrushlv/article/details/82634189

 

猜你喜欢

转载自blog.csdn.net/DOOMDADADIVIDA/article/details/84337280