Processing と openFrameworks の比較

update/2020.12.9
Processing を openFrameworks で使いたい、またその逆、メモ。

【画面サイズ】
Processing は size(width, height, depth); 2Dの場合 size(width, height) ;
openFrameworks は main.cpp 内にて、すでに設定されています。>>ofSetupOpenGL(1024,768,OF_WINDOW);
------------------------
//Processing
size(width, height) ;
//openFrameworks
ofSetupOpenGL(1024,768,OF_WINDOW);  
【点】
Processing は point(点) を利用できますが、openFrameworks にはないので、Circle(円)を小さくして使います。 
------------------------
//Processing
point(x, y);
//openFrameworks
ofDrawCircle(x, y, radius); // x, y は中心点、radiusは半径
【線】
x1, y1 から x2, y2  までのline(線)
------------------------
//Processing
line(x1, y1, x2, y2); // x1, y1 から x2, y2 までの線
//openFrameworks
ofDrawline(x1, y1, x2, y2); // x1, y1 から x2, y2 までの線
【円】
ellipse(楕円)、circle(円)
------------------------
//Processing
ellipse(x1, y1, width, height); // x1, y1 中心からの幅と高さ
//openFrameworks
ofDrawellipse(x1, y1, width, height); // x1, y1 中心からの幅と高さ
ofDrawCircle(x1, y1, radius); // x, y は中心点、radiusは半径
【四角】
rectangle(四角)
------------------------
//Processing
rect(x1, y1, x2, y2); // 始点 x1, y1 から 対角 x2, y2 の四角
//openFrameworks
ofDrawRectangle(x1, y1, x2, y2); // 始点 x1, y1 から 対角 x2, y2 の四角

続く。


ありがとうございます。