2009/08/30

『空想』

さっきの女の人に色々つけてみた。うん、まぁまぁかな。
でも何か、あんまり美人じゃない気もしてきたなぁ・・・

2009/08/28

だいぶマシになってきた

耳とかはどうせ半分以上隠れるので適当ですが、だいぶマシになってきました。

2009/08/27

Photoshopでリアル絵

作業中。
いやぁ、リアル絵はなかなか難しいですね。Photoshopで描くことに慣れてないぶん余計にそう感じます。てかそもそもリアル絵あんまり描かないからそれもキツい原因ですね。

2009/08/24

パンフレットの表紙 (5)

最近はタイポグラフィの美しさというものを考えるようになりました。勉強してみます。

2009/08/22

パンフレットの表紙 (4)


またまた作ってみた。今回のは雑誌の表紙みたいになった。
結構気に入ってる。

パンフレットの表紙 (3)

これは自分でも結構気に入ってます。
Photoshopの使い方も覚えてきた。後はこれが我が校のパンフレットの表紙になることを願うのみです。

2009/08/19

ProcessingでGlow表現

Glow表現ってやっぱり華やかだし、それがあるだけでカッコよく見える。
今回はOpenGLを使ってGlow表現を試してみました。
参考にしたのはこのサイト。

スクリーンショットだと分かりにくいですが、星と煙(?)はガクガク揺れてます。
Z方向にバウンドする壁を設けていないので、時間が経つと↑こんな感じになります。
少しいじるとビジュアライザに応用できそう・・・

flight404は正方形を作ってそこにテクスチャとして画像を貼付けているようですが、僕は手抜きをしてProcessingにもとから付いてるimage()メソッドを使いました。

ソースコードは以下。何も考えずに書いていったので綺麗じゃないかもしれませんが・・・
ここからzipファイルをダウンロードできます。こっちは画像が入ってます。)



/***********************************
 *
 * Opengl_glow.pde
 *
 ***********************************/

int STARS_NUM = 200;
int CORONA_NUM = 100;
float GRAVITY = 0.1;
float MAX_VELOCITY = 5;

Star[] stars = new Star[STARS_NUM];
Corona[] coronas = new Corona[CORONA_NUM];

void setup(){
  size(800,400,OPENGL);
  hint( ENABLE_OPENGL_4X_SMOOTH );
  background(0);

  PImage coronaImg=loadImage("corona.png");
  for(int i=0; i<CORONA_NUM; i++){
    float w=random(20,200);
    float h=w;
    Point pos = new Point(random(0+w,width-w), random(0+h,height-h));
    PVector vel = new PVector(random(-2,2), random(-2,2));
    coronas[i] = new Corona(coronaImg,pos,vel,w,h); 
  }

  PImage starImg = loadImage("star.png");
  for(int i=0; i<STARS_NUM; i++){
    float w=random(1,30);
    if(i%23==0) w=random(70,100);
    float h=w;
    Point pos = new Point(random(0+w,width-w), random(0+h,height-h));
    PVector vel = new PVector(random(-6,6), random(-6,6));
    stars[i]=new Star(starImg,pos,vel,w,h);
  }
}

void draw(){
  newFrame();
  glUtil();
  for(int i=0;i<CORONA_NUM; i++){
    coronas[i].move();
    coronas[i].bounce();
    coronas[i].display();
  }
  for(int i=0; i<STARS_NUM; i++){
    stars[i].move();
    stars[i].bounce();
    stars[i].display();
  }
}

void newFrame(){
  background(0,20);
}

/***********************************
 *
 * Point.pde
 *
 ***********************************/

class Point{
  float x;
  float y;
  float z;
  
  Point(){ }
  Point(float x,float y){
    this.x = x;
    this.y = y;
  }
  Point(float x,float y,float z){
    this(x,y);
    this.z = z;
  }
}
/***********************************
 *
 * Star.pde
 *
 ***********************************/

class Star{
  PImage starImg;
  
  Point pos = new Point();
  PVector vel = new PVector();
  
  float w;
  float h;
  
  Star(){ }
  Star(PImage starImg,Point pos,PVector vel,float w,float h){
    this.starImg=starImg;
    this.pos = pos;
    this.vel = vel;
    this.w = w;
    this.h = h;
  }
  
  void display(){
    pushMatrix();
    translate(0,0,pos.z);
    image(starImg,pos.x-w/2,pos.y-h/2,w,h);
    popMatrix();
  }
  
  void move(){
    pos.x+=random(-5,5);
    pos.y+=random(-5,5);
    pos.z+=random(-10,10);
  }
  
  void bounce(){
    if(pos.x+w/2>width || pos.x-w/2<0){
      vel.x*= -1;
      if(pos.x+w/2>width) pos.x=width-w/2;
      else pos.x=w/2;
    } 
    if(pos.y+h/2>height || pos.y-h/2<0){
      vel.y*= -1;
      if(pos.y+h/2>height) pos.y=height-h/2;
      else pos.y=h/2;
    }
  }
}
/***********************************
 *
 * Corona.pde
 *
 ***********************************/

class Corona extends Star{
  
  PImage coronaImg;

  Corona(){ }
  Corona(PImage coronaImg, Point pos, PVector vel, float w, float h){
    super(coronaImg, pos, vel, w, h);
  }
}
/***********************************
 *
 * Util.pde
 *
 ***********************************/

import processing.opengl.*;
import javax.media.opengl.*;


PGraphicsOpenGL pgl;
GL gl;

protected void glUtil() {
 pgl = (PGraphicsOpenGL) g;
 //gl = pgl.gl;
 //pgl.beginGL();
        gl=pgl.beginGL();
 gl.glDisable(GL.GL_DEPTH_TEST); // This fixes the overlap issue
 gl.glEnable(GL.GL_BLEND);// Turn on the blend mode
 gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE); // Define the blend mode
 pgl.endGL();
}

public void capture(char str) {
 if(keyPressed && key == str) {
  saveFrame("data/img-####.png");
  
 }
} 

public void vertex(PVector p) {
 vertex(p.x, p.y, p.z);
}
/** Utility for PVector class
@param c1 control 1 of PVector class
@param c2 control 2 of PVector class
@param p point of PVector class
*/
public void bezierVertex(PVector c1, PVector c2, PVector p) {
 bezierVertex(c1.x, c1.y, c1.z, c2.x, c2.y, c2.z, p.x, p.y, p.z);
}
public void curveVertex(PVector p) {
 curveVertex(p.x, p.y, p.z);
}

2009/08/18

カオス

アルゴリズムの本に載ってたんでProcessingで作ってみた。ストレンジアトラクタとかいう類のものなんだけど、僕はこういう数学的なの結構好きだ。
フラクタルとか面白いよね。
ちなみにこれは
p_{n+1}=p_n+kp_n(1-p_n)
という漸化式でn->無限大 にしたとき係数kの値によって収束したり、しなかったりするものです。
収束しないときはこれまた係数kによって何個かの値を交互に取ったり、もはや規則性が見えなくなってカオス状態になってしまったりというものです。
画像は横軸を係数、縦軸にpをとったもの。
以下ソースコード。

int i;
float k,p,dk,kmin,kmax,pmin,pmax;

kmin=1.5;
kmax=3.0;
pmin=0.0;
pmax=1.5;

size(600,400);
colorMode(HSB,100);
background(10);
smooth();

dk=(kmax-kmin)/(width-1);

for(k=kmin;k<=kmax;k+=dk){
p=0.3;
for(i=1;i<=1000;i++) p+=k*p*(1-p);
for(i=1001;i<=1400;i++){
if(p>=pmin&&p<=pmax){
float Pk=map(k,kmin,kmax,0,width);
float Pp=map(p,pmin,pmax,0,height);
//stroke(99);
//point(Pk,height-Pp);
noStroke();
float r=random(0.1,1.5);
fill(random(0,20),99,99);
ellipse(Pk,height-Pp,r,r);
}
p+=k*p*(1-p);
}
}

2009/08/16

パンフレットの表紙 (2)

ウチの学校のパンフレットの表紙にこれは似合わない(笑)
てか学校なんてお堅いから、こういう系は絶対拒否るでしょうね。
Photoshopは楽しいですね

パンフレットの表紙

8/24までに学校のパンフレットの表紙デザインを考えてこないといけないので、どんなのがいいかなぁと一つ作ってみました。

2009/08/14

CGクリエイター検定2級合格

実は、7月14日に僕は一人こっそりと三宮の神戸電子専門学校に行ってある試験を受けてました。
その試験というのは、CG-ARTS協会の「CGクリエイター検定ディジタル映像部門」、通称「CGクリエイター検定」2級です。

で、今日ネットで合否確認をした結果

合格してました \(^^)/
やったね!