Convert a Processing example to Openframeworks

Hi,every one! I am a beginner of Openframeworks, I want to convert a Processing example to Openframeworks,I have tried it by myself,but it was not success. I hope some body help me to do it. Thank you very much! The Processing example is here:Processing Color Smoke example
the detail code is as below:

var np = 300;
var startcol;

function setup() {
createCanvas(1366, 600);
background(255);
noFill();
noiseSeed(random(100));
startcol = random(255);
}

function draw() {
// background(51);
beginShape();
var sx, sy;
for(var i = 0; i < np; i++) {
var angle = map(i, 0, np, 0, TWO_PI);
var cx = frameCount * 2 - 200;
var cy = height / 2 + 50 * sin(frameCount / 50);
var xx = 100 * cos(angle + cx / 10);
var yy = 100 * sin(angle + cx / 10);
var v = createVector(xx, yy);
xx = (xx + cx) / 150; yy = (yy + cy) / 150;
v.mult(1 + 1.5 * noise(xx, yy));
vertex(cx + v.x, cy + v.y);
if(i == 0) {
sx = cx + v.x;
sy = cy + v.y;
}
}
colorMode(HSB);
var hue = cx / 10 - startcol;
if(hue < 0) hue += 255;
stroke(hue, 100, 120);
strokeWeight(0.1);
vertex(sx, sy);
endShape();
if(frameCount > width + 500) {
noLoop();
}
}

Can you post here what have you tried?

Hi, edapx! Thank you for your reply. My code is as below:

double startcol;
int np = 300;

//--------------------------------------------------------------
void ofApp::setup(){
ofBackground(255);
ofNoFill();
ofSetBackgroundAuto(false);
ofSetFrameRate(60);
}

//--------------------------------------------------------------
void ofApp::update(){

}

//--------------------------------------------------------------
void ofApp::draw(){
double width = 1024;
double height = 768;

ofBeginShape();

double cx, cy;
double sx, sy;
for (int i = 0; i < np; i++) {
	double angle = ofMap(i, 0, np, 0, TWO_PI);
	cx = ofGetFrameNum() * 2 - 200;
	cy = height / 2 + 50 * sin(ofGetFrameNum() / 50);
	double xx = 100 * cos(angle + cx / 10);
	double yy = 100 * sin(angle + cx / 10);
	ofVec2f v = ofVec2f(xx, yy);
	xx = (xx + cx) / 150; yy = (yy + cy) / 150;
	v * (1 + 1.5 * ofNoise(xx, yy));
	ofVertex(cx + v.x, cy + v.y);
	if (i == 0) {
		sx = cx + v.x;
		sy = cy + v.y;
	}
}
double hue = cx / 10 - startcol;
if (hue < 0) hue += 255;

ofSetColor(ofColor::fromHsb(hue, 255, 255));
ofSetLineWidth(0.1);
ofVertex(sx, sy);

ofEndShape();

}