GEM-TEST from kicko on Vimeo.
這個小動畫本來是這次openframeworks工作坊時的小練習
而我則是用puredata用相同的原理將它做出來
以下是openframeworks的程式碼
----------------------------------------------------
#include "testApp.h"
#define NUM 24
ofPoint pos[NUM];
float angle;
ofPoint rot;
//--------------------------------------------------------------
void testApp::setup(){
ofBackground(0, 0, 0);
ofSetFrameRate(60);
ofSetCircleResolution(64);
}
//--------------------------------------------------------------
void testApp::update(){
angle += 0.02;
for (int i=0; i
pos[i].x = sin(angle*i/NUM)*200 ;
pos[i].y = cos(angle*i/NUM)*200 ;
}
}
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(31, 127, 255);
ofNoFill();
ofTranslate(ofGetWidth()/2,ofGetHeight()/2 );
ofRotateX(rot.x);
ofRotateY(rot.y);
for (int i=0; i
ofCircle(pos[i].x, pos[i].y, i*200.0/NUM);
}
}
------------------------------------------------------------------
以下則是puredada的做法:

ps 特別感謝李駿的友情指點
沒有留言:
張貼留言