@coderguy1777 wrote:
Is there a place that has a guide for proper contributions and pull requests to the OF frameworks repo that I missed as I cant seem to find one.
Posts: 2
Participants: 2
@coderguy1777 wrote:
Is there a place that has a guide for proper contributions and pull requests to the OF frameworks repo that I missed as I cant seem to find one.
Posts: 2
Participants: 2
@toson77 wrote:
Hi, I am a new user of OF. I want to receive and process multiple midi port at the same time, but I do not know how. I use ofxMidi now.
Posts: 1
Participants: 1
@quappefeeder wrote:
Hello everybody,
I am trying to install OF my my Pi 3B+. But there are something wrong.
When I run “install_dependencies.sh”, it shows:selecting 'libsndfile1-dev' instead of 'libsndfile-dev' Package libgles1-mesa-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: libglvnd-dev
So I edited the install_dependences.sh. I changed the “libgles 1-mesa-dev” into “libglvnd-dev”.
And then, everything runs perfectly.
But, when I compile a new project, I will always show:
it was missing `__atomic_fetch_add_8’.
Does anyone knows, how can I sovle this problem?
I have some experience on OF Mac, but I am very new to OF on RPi…
Looking for Help
Posts: 1
Participants: 1
@cuinjune wrote:
Is there Zip Archive/Unarchive functionality in OF core or should I download an addon for this?
Also, is there an easy-to-use addon for this purpose?
I tried https://github.com/jeffcrouse/ofxZipArchive but could not build it out of the box as it seems to be depending on Poco from old OF version.
Posts: 2
Participants: 2
@RaCompTeur wrote:
Hello,
Can you help please?
I’m trying to convert some Processing code into Open Frameworks, but am struggling because OF doesn’t have Stroke.
Here is the original code:
void draw() {
// background(0, 0, 0, 1);
noStroke();fill(0, 0, 0, 32);
rect(0, 0, width, height);noFill();
float count = 12;
float i = 0; float j = 0;
float x = width / 2 + (sin(xmotion * 0.5) * width / 16);
float y = height / 2 + (cos(zmotion * 0.75) * height / 16);for (j = 0; j < 1; j += 0.002) {
float jnorm_j = abs(0.5 - j) * 2;
for (i = 0; i < count; i += 1) {
float norm_i = i / count;
float unit_i = 1 / count;float inorm_i = abs(0.5 - norm_i) * 2; float n = noise(inorm_i + xmotion, jnorm_j + ymotion) / 128; float rad1 = radius + cos(xmotion * PI * 4 + inorm_i * PI * 32 + jnorm_j * PI * 8) / (0.4 + abs(sin(xmotion) * 2)); float rad2 = radius + sin(ymotion * PI * 4 + inorm_i * PI * 32 + jnorm_j * PI * 8) / (0.4 + abs(cos(zmotion) * 2)); float cx = rad1 * sin(norm_i * PI * 2 + n * 4 + xmotion + (j * PI * 2)) + sin(xmotion*2) * 24; float cy = rad1 * cos(norm_i * PI * 2 + n * 4 + ymotion + (j * PI * 2)) + cos(ymotion*2) * 24; float cx2 = rad2 * sin((unit_i + norm_i) * PI * 2 + xmotion + (j * PI * 2)) + sin(xmotion*2) * 24; float cy2 = rad2 * cos((unit_i + norm_i) * PI * 2 + ymotion + (j * PI * 2)) + cos(ymotion*2) * 24; //stroke(0, 0, 0, 128);
// line(x + cx, y + cy, x + cx2, y + cy2);
line(x + cx / 2, y + cy / 2, x + cx2 / 2, y + cy2 / 2);
stroke(192 + inorm_i * 128 + jnorm_j * 128, 128 * (1-j), 256, 256 * (n * 32));line(x + cx / j, y + cy / j, x + cx2 / j, y + cy2 / j); noStroke();
Here is my adaptation:
ofFill(); ofSetColor(0, 0, 0, 3); ofDrawRectangle(0, 0, ofGetWidth(), ofGetHeight()); ofNoFill(); // ofDrawCircle(ofGetWidth()/2, ofGetHeight()/2, ofRandom(100)); count = 12; float i = 0; float j = 0; float x = ofGetWidth() / 2 + (sin(xmotion * 0.5) * ofGetWidth() / 16); float y = ofGetHeight() / 2 + (cos(zmotion * 0.75) * ofGetHeight() / 16); for (j = 0; j < 1; j += 0.002) { float jnorm_j = abs(0.5 - j) * 2; for (i = 0; i < count; i += 1) { float norm_i = i / count; float unit_i = 1 / count; float inorm_i = abs(0.5 - norm_i) * 2; //float n = noise(inorm_i + xmotion, jnorm_j + ymotion) / 128; float n = ofNoise(inorm_i + xmotion, jnorm_j + ymotion) / 128; float rad1 = radius + cos(xmotion * PI * 4 + inorm_i * PI * 32 + jnorm_j * PI * 8) / (0.4 + abs(sin(xmotion) * 2)); float rad2 = radius + sin(ymotion * PI * 4 + inorm_i * PI * 32 + jnorm_j * PI * 8) / (0.4 + abs(cos(zmotion) * 2)); float cx = rad1 * sin(norm_i * PI * 2 + n * 4 + xmotion + (j * PI * 2)) + sin(xmotion*2) * 24; float cy = rad1 * cos(norm_i * PI * 2 + n * 4 + ymotion + (j * PI * 2)) + cos(ymotion*2) * 24; float cx2 = rad2 * sin((unit_i + norm_i) * PI * 2 + xmotion + (j * PI * 2)) + sin(xmotion*2) * 24; float cy2 = rad2 * cos((unit_i + norm_i) * PI * 2 + ymotion + (j * PI * 2)) + cos(ymotion*2) * 24; ofSetColor(192 + inorm_i * 128 + jnorm_j * 128, 128 * (1-j), 256, 256 * (n * 32)); ofDrawLine(x + cx / 2, y + cy / 2, x + cx2 / 2, y + cy2 / 2); ofDrawLine(x + cx / j, y + cy / j, x + cx2 / j, y + cy2 / j);
I’ve dropped the original Stroke values, (192 + inorm_i * 128 + jnorm_j * 128, 128 * (1-j), 256, 256 * (n * 32)), into ofSetColor, without the desired effect. What might I be doing wrong? How can i do the same thing in OF without using Stroke?
Thanks in advance :)
Posts: 4
Participants: 3
@lata1410 wrote:
Hi! I need to design an interface for a new software developed in openFrameworks. The idea is that it is a new interface and not an implementation of others. I need recommendations. In what format should I design the elements of my interface? SVG? Do I need to program it in oF code or can I export files designed in another program for example in Illustrator?
Thanks!
Posts: 3
Participants: 2
@a__ wrote:
I’d like to pass multiple arguments (in this case a position, radius, and color) when calling an ofEvent. It seems ofEvent doesn’t support multiple arguments so I’ve tried wrapping them in a struct and just passing the struct, but I’m not sure I’m doing that right. I get this error when trying to do so:
From the output:
…\of_v0.10.1_vs2017_release\libs\openFrameworks\events\ofEvent.h(535,1): error C2661: ‘ofEventMyClass::args_drawCircle,std::recursive_mutex::make_function’: no overloaded function takes 3 arguments (compiling source file src\ofApp.cpp)
and
…\of_v0.10.1_vs2017_release\libs\openFrameworks\events\ofEvent.h(535,3): error C2672: ‘ofEventMyClass::args_drawCircle,std::recursive_mutex::addNoToken’: no matching overloaded function found (compiling source file src\ofApp.cpp)
I’m confused as to what I’m doing wrong as it says I have the wrong number of arguments but am using the same number of args (1 struct obj) as one would with an ofEvent that just passes an int or bool. What’s the proper way to pass a whole bunch of args via ofEvents?
Here’s the MVCE:
ofApp.h
#pragma once #include "ofMain.h" #include "MyClass.h" class ofApp : public ofBaseApp { public: void setup(); void update(); void draw(); void mousePressed(int x, int y, int button); struct args_drawCircle { int x; int y; ofColor col; float rad; }; void drawCircle(args_drawCircle& args); MyClass myClass; };
ofApp.cpp
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup() { // This seems to be the culprit- if you comment out this line build compiles successfully: ofAddListener(myClass.calldrawCircleEvent, this, &ofApp::drawCircle); } //-------------------------------------------------------------- void ofApp::update() {} //-------------------------------------------------------------- void ofApp::draw() {} //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button) { myClass.mousePressed(); } //-------------------------------------------------------------- void ofApp::drawCircle(args_drawCircle& args) { ofLogNotice("ofApp::drawCircle") << endl << "x: " << args.x << endl << "y: " << args.y << endl << "rad: " << args.rad << endl << "col: " << args.col << endl; ofSetColor(args.col); ofDrawCircle(args.x, args.y, args.rad); }
MyClass.h
#pragma once #include "ofMain.h" class MyClass { public: void setup(); void update(); void draw(); void mousePressed(); struct args_drawCircle { int x; int y; ofColor col; float rad; }; ofEvent<args_drawCircle> calldrawCircleEvent; };
MyClass.cpp
#include "MyClass.h" void MyClass::setup() {} void MyClass::update() {} void MyClass::draw() {} void MyClass::mousePressed() { args_drawCircle args; args.x = ofGetMouseX(); args.y = ofGetMouseY(); args.col = ofColor(ofRandom(0,255)); args.rad = ofRandom(10,50); ofNotifyEvent(calldrawCircleEvent, args, this); }
Posts: 1
Participants: 1
@tanikapod wrote:
I don’t think mine is a third party distribution, so I don’t think the errors I’m getting are because of that. When I run scripts/linux/ubuntu/install_dependencies.sh, I first get a few “service unavailable” and “The following signatures couldn’t be verified because the public key is not available” errors followed by “Some index files failed to download. They have been ignored, or old ones used instead.” I don’t know how much of a problem this is.
I then answer “Yes” to the question “Your system is not updated, that can create problems when installing the OF dependencies. Do you want to update all the packages now?”, after which I get a large number of ROS packages saying they “failed to fetch” and “service unavailable”. I am not sure if I should try to fix this or of updating the system is really necessary - maybe I should just answer “No”?
Then when installing dependencies, I also get the following error:
Installing libgl1-mesa-dev-hwe-16.04
E: Unable to locate package libgl1-mesa-dev-hwe-16.04
E: Couldn’t find any package by glob ‘libgl1-mesa-dev-hwe-16.04’
E: Couldn’t find any package by regex ‘libgl1-mesa-dev-hwe-16.04’
error installing libgl1-mesa-dev-hwe-16.04
Reading package lists… Building dependency tree… Reading state information…
this seems an error with your distribution repositories but you can also
report an issue in the openFrameworks githubI’m not sure what “error with your distribution repositories” means I should do.
Posts: 2
Participants: 2
@Edward_Ward wrote:
Hello,
I am hoping to export curves that I have drawn in 3D using
ofPolyline straightSegmentPolyline;
I have looked at ofxDxfExport but that is 2D only.
Should I export as an .obj using ofMesh? I presume I would have to draw my curves differently, as a
GL_LINE_STRIP
?The aim is to get the curve so I can open it in a convention CAD program and work on it from there…
Thanks.
Posts: 1
Participants: 1
@Poulp wrote:
Hello, I’m a bit lost on how to manage retina screen with openframework.
I tried to set
High Resolution Capable
option toYES
from theopenframeworks-info.plist
file, so the windows title looks fine, but depending of the windows width I set the result is different. Does this plist parameter is the right way to manage retina screen ?My display is a native 3840x2160, so if I setup a windows of 1920x1080, the windows cover a quarter of my screen and the pixelScreenCoordScale is = 2 so it’s seems ok for me. But, if I setup a windows of 1921x1080 the pixelScreenCoordScale = 1, this issue seems to only appears on the width parameter, not the height one.
If anyone have any tips on how to manage high resolution screen it would be super nice
Posts: 1
Participants: 1
@JDeut wrote:
This may be the most “beginner” question to ask - and it only partially relates to OF, but since I’m attempting to learn XCode and C++ as a means of using OF, I guess this is the place to ask it:
Currently, in order to run the examples, I create a new XCode project file with the OF projectGenerator, clear out the SRC code and replace it with the code from the tutorials.
Is there a guide to understanding how to create a new OF project independently? I think it would be helpful to know what goes on with the automated process.
Posts: 1
Participants: 1
@JDeut wrote:
I’m not sure what the proper nomenclature is for this stuff, since I’m just learning - so please excuse my mislabeling for the time being.
My understanding is that ofRandom is a random function - and functions evaluate at frame rate within the draw() and update() functions.
I’m working with the “singleLightExample” in the examples folder - and part of the code uses a for loop:
for(int i = 0; i < numSpheres; i++) {
float angle = TWO_PI / (float)numSpheres * i;
float x = cos(angle) * radius;
float y = sin(angle) * radius;
ofDrawSphere(x, y, -200, sphereRadius);
}I’d like to generate a random value for each sphereRadius, one time.
Is the best way to do this to somehow populate an array in the setup() function with one-time generated values and then find a way to feed them into the for loop?
Posts: 4
Participants: 3
@JDeut wrote:
I’m working on a bit of code to make something happen every couple of seconds.
The idea was something like this:if (ofGetElapsedTimef() % 8) {
printf(“ok, it’s working”);
}But this throws an error about floats - maybe having something to do with floating-point resolution in C++. So, I end up trying:
if (fmod(ofGetElapsedTimef(), 8)){
printf(“ok, it’s working”);
}And this does not work like expected.
Any thoughts on how to do this and why this approach isn’t working?
Posts: 2
Participants: 2
@bemoregt wrote:
Hi, All.
I want to convert this processing code to OF.
float boxSize = 2; //立方体のサイズの初期値
float distance = 28; //縦方向の立方体同士の距離
float halfDis; //立方体同士の一辺の全体の距離の半分
float radius = 4; //x, y軸方向の立方体の距離の初期値
int boxNum = 8; //立方体の数
int angleX = -50; //x軸を中心とした回転角度の初期値
int angleZ = 0; //z軸を中心とした回転角度の初期値void setup() {
size(400, 400, P3D);
colorMode(HSB, 360, 100, 100);//立方体を縦方向に並べた際の距離の半分
halfDis = distance*(boxNum - 1)/2;noStroke();
}void draw() {
background(0);translate(width/2, height/2); //基準点を画面中央に移動
rotateX(radians(-angleX)); //x軸を中心に回転
rotateZ(radians(-angleZ)); //z軸を中心に回転for (int z = 0; z < boxNum; z ++) { //縦にも増やす
for (int angle = 0; angle < 360; angle += 15) { //15度ずつ移動//boxNumの数だけx軸方向に立方体を増やす for (int i = 0; i < boxNum; i ++) { pushMatrix(); //円状に配置するためのxy座標の計算 float x = i*(radius + i*1.5)*cos(radians(angle)); float y = -i*(radius + i*1.5)*sin(radians(angle)); float saturation = float(i)/float(boxNum - 1)*100.0; //彩度を計算 float brigtness = float(z)/float(boxNum - 1)*100.0; //明度を計算 translate(x, y, z*distance - halfDis); //一つずつ移動させる rotateZ(radians(-angle)); //円状に配置 fill(angle, saturation, brigtness); //色を指定する //立方体を描く box(boxSize + boxSize*i, boxSize + boxSize*i, boxSize + boxSize*i); popMatrix(); } }
}
}How can ?
Thanks in advance.
Posts: 4
Participants: 2
@Drazinut wrote:
I’m wanting to use the Android virtual keyboard in an OF Android app. I notice there are methods for the virtual keyboard on iOS for iPhone apps (ofxiOSKeyboard), but I don’t see any in the documentation for ofxAndroid.
All I’ve found so far are two questions here in this forum about ways to get it to work:
Looking for extensions on ofxaddons.com, I see:
ofxSoftKeyboard - but the description/documentation seems to just be the sentence “just shows keyboard”?
ofxKeyboard - the documentation here is also so minimal I have no idea what this does but I don’t think it has anything to do with the Android keyboard.So would I be right that the most support and documentation on using the Android keyboard in an OF Android app would be in those two forum questions linked above?
Thanks!
Posts: 1
Participants: 1
@sandufi wrote:
Hello,
I’m building a wordcloud in a 3D space but the text doesn’t seem to be opaque when it’s in front of other text.
struct Word { string text; float val; int pos_x; int pos_y; int pos_z; } ; std::vector <Word> words; ofTrueTypeFont font; ofEasyCam cam; void ofApp::setup(){ font.load("font.ttf", 100); for(int i = 0; i < 7500; i++){ Word word; word.text = "test"; word.val = ofRandom(-1.0,1.0); word.pos_x = ofRandom(-2000,2000); word.pos_y = ofRandom(-2000,20000); word.pos_z = ofRandom(-6000,2000); words.push_back(word); } } //-------------------------------------------------------------- void ofApp::update(){ } //-------------------------------------------------------------- void ofApp::draw(){ ofBackground(0); cam.begin(); for (Word & word : words) { if(word.val >= 0.0) ofSetColor(255, 0, 0, 255); else ofSetColor(0, 255, 0, 255); ofPushMatrix(); ofTranslate(word.pos_x,word.pos_y,word.pos_z); font.drawString(word.text, 0, 0); ofPopMatrix(); } cam.end(); }
Thanks,
Joan
Posts: 1
Participants: 1
@RaCompTeur wrote:
Hey gang,
How would you recreate the effects of noiseDetail for graphics in processing, but using openFrameworks?
Any help appreciated.
Thanks,
James
Posts: 1
Participants: 1
@novas_fronteiras wrote:
hi, everyone;
i am sending data by dmx from a video as below:
std::vector<uint8_t> artnetData; r_sky1 = static_cast<unsigned char>(ofMap(player.getPixels().getColor(offXart, offYart).r, 0, 255, mapIn, mapOut); artnetData.push_back(r_sky1); ofxArtnetMessage m; m.setData(artnetData); artnet.sendArtnet(m);
but, as I am passing this video inside a cascade of fbos and shaders, would be perfect to getColor from the final Fbo. as I saw, there isnt anything like fbo.getColor(x,y);, but is there any other way i am missing to do it?
thank you!
Posts: 3
Participants: 2
@lewislepton wrote:
so im really playing with the Kinect V1 [& V2 to that effect] & playing with ofxOpenCv works to a great point. but once we bring in things like the ofxCvHaarFinder in, to bolts everything down pretty horribly to a snails pace.
in some ways I feel its my own computer, but things do generally work pretty well, even for its age & specs [which are not bad]but I did break down the project, just to find what this thing that was slowing it down could be, it is the haar finder.
trying it with the built in camera as well, just in case - still brings slow results, but slightly quicker, even if the resolution is higheris there any good pointers, or work arounds to utilise it better. or is it a slow thing in general? from seeing other examples/videos of people work in ofxOpenCv, it seems pretty fast. but im sure its just setup more than anything
my setup is as follows:
ofApp.h
ofVideoGrabber grab; ofxCvColorImage colorImage; ofxCvGrayscaleImage grayImage; ofxCvHaarFinder haar;
ofApp.cpp
void ofApp::setup(){ grab.setup(640, 480); colorImage.allocate(grab.getWidth(), grab.getHeight()); grayImage.allocate(grab.getWidth(), grab.getHeight()); haar.setup("haarcascade_frontalface_default.xml"); } //-------------------------------------------------------------- void ofApp::update(){ grab.update(); if (grab.isFrameNew()){ colorImage.setFromPixels(grab.getPixels()); grayImage = colorImage; haar.findHaarObjects(grayImage); } } //-------------------------------------------------------------- void ofApp::draw(){ grab.draw(0, 0); int faces = haar.blobs.size(); for (int i = 0; i < faces; i++) { float x = haar.blobs[i].boundingRect.x; float y = haar.blobs[i].boundingRect.y; float w = haar.blobs[i].boundingRect.width; float h = haar.blobs[i].boundingRect.height; float cx = haar.blobs[i].centroid.x; float cy = haar.blobs[i].centroid.y; ofSetColor(255); ofNoFill(); ofDrawRectangle(x, y, w, h); ofSetColor(255); ofDrawBitmapString("face " + ofToString(i), cx, cy); } }
I have taken the kinect stuff out, if anyone else wants to look at. but can easily be put back in & utilised
but I am at a loss in how I can speed this up, so any pointers would be great. links, books, examples, videos etc
thanks
Posts: 2
Participants: 2