@kotaonaga wrote:
Hi!
I am trying to create Metaballs like this tutorial.
I tried to write the equivalent of this Processing’s code in oF.
I tried to useofImage
, but it was too heavy for the animation.
Are there any ways to do this not usingofImage
?Processing code that I want to use:
color pink = color(255, 102, 204); loadPixels(); for (int i = 0; i < (width*height/2)-width/2; i++) { pixels[i] = pink; } updatePixels();
My oF code:
void ofApp::draw(){ ofColor pink = ofColor(255, 102, 204); ofImage img; img.allocate(300, 300, OF_IMAGE_COLOR); for(int width = 0; width < ofGetWidth(); width++){ for(int height = 0; height < ofGetHeight(); height++){ img.setColor(width, height, ofColor(pink)); } } img.update(); img.draw(0, 0); }
Thank you!
Posts: 3
Participants: 2