'OF example'에 해당되는 글 1건
- 2009.08.07 Random color Block
OF로 간단히 만들어본 컬러 블록
testApp.cpp 파일에 붙여넣으세요
//--------------------------------------------------------------
void testApp::setup(){
ofBackground(0, 0, 0); // background color setting 0~255 (R, G, B)
ofEnableSmoothing();
ofSetRectMode(OF_RECTMODE_CORNER);
ofSetCircleResolution(11);
}
//--------------------------------------------------------------
void testApp::update(){
}
//--------------------------------------------------------------
void testApp::draw(){
ofFill();
for( int i = 0; i < ofGetWidth(); i++){
for(int j = 0; j < ofGetHeight(); j++){
ofSetColor(ofRandom(0, 255), ofRandom(0, 255), ofRandom(0, 255));
//ofCircle(ofRandom(0, ofGetWidth()), ofRandom(0,ofGetHeight()), 30);
//ofEllipse(i*50, j* 50, 50, 50);
ofRect(i*50, j*50, 50, 50);
}
}
}