元の画像を拡大してアルファ値を少なくしたものを元画像の上から描画すればできる。ということなので、以下のようなプログラムをくんでみた。
openframeworksを使用しています。
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
test.loadImage("Nero.png");
}
//--------------------------------------------------------------
void testApp::update(){
for( int i=0; i
#include
//--------------------------------------------------------------
void testApp::setup(){
test.loadImage("Nero.png");
}
//--------------------------------------------------------------
void testApp::update(){
/*for( int i=0; i<MAX_RADIAL; i++){
copy[i].clone(test);
copy[i].resize(test.width * (1.05f + i * 0.05f), test.height * (1.05f + i * 0.05f));
}*/
}
//--------------------------------------------------------------
void testApp::draw(){
test.draw(0,0);
int x,y;
x = 0;
y = 0;
for( int i=0; i<MAX_RADIAL; i++){
copy[i].clone(test);
copy[i].resize(test.width * (1.05f + i * 0.05f), test.height * (1.05f + i * 0.05f));
//test.resize(test.width * (1.05f + i * 0.05f), test.height * (1.05f + i * 0.05f));
//glTexSubImage2D(GL_TEXTURE_2D, 0, x, y,test.width, test.height, GL_RGB, GL_UNSIGNED_BYTE, &test);
ofSetColor(255,255,255,90 - i * i);
ofEnableAlphaBlending();
float posx, posy, first_w, first_h;
first_w = (test.width * 0.025);
first_h = (test.height * 0.025);
//// 元画像の幅、高さの拡大率の半分だけ描画位置をずらす
posx = 0 - ( first_w ) - (first_w * i);
posy = 0 - ( first_h ) - (first_h * i);
copy[i].draw(posx,posy);
//test.draw(0,0);
ofDisableAlphaBlending();
}
}
フィードバックブラーについていろいろ調べてみるとDXでやっているのが多いみたいだから、一回DXの勉強をして使ってみようかな。
結局実装はopenframeworksでしたいのだけれども・・・・制作展のものだし、早くできるようにしたいな。