Quantcast
Channel: beginners - openFrameworks
Viewing all 4929 articles
Browse latest View live

Specify True and False for the ofxButton's trigger

$
0
0

@taketori7616 wrote:

Is there a way to specify True and False of ofxButton's trigger in ofApp.cpp?
For example,

ofxButton btn;
gui.add (btn.setup ("btn", false));
btn = true;

like

Posts: 1

Participants: 1

Read full topic


How can I add advertisement support like adMob?

$
0
0

@WalkingBrain wrote:

Hello everyone,

I'm working on basic game & apps development for mobile with openFrameworks and I am trying to add advertisement support. So, how can i add ads system like admob or chartboost? If you know that, please inform me!

Thanks everyone :slight_smile:

Posts: 1

Participants: 1

Read full topic

About creating TreeMap

$
0
0

@taketori7616 wrote:

I would like to create a TreeMap like the image below, but do you have anything to help with?

If you like, I would like to write simple source code.

Posts: 1

Participants: 1

Read full topic

ofDrawCircle(...) facing ofCamera - SOLVED

$
0
0

@vanderlin wrote:

Looking to get a shape to always face a ofCamera. Here is a basic example, at some point the circle is flipped and not working anymore. Is there a simple better way to make this happen?

ofEasyCam cam;

//--------------------------------------------------------------
void ofApp::setup(){
    cam.setDistance(80);
}

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

}

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

    ofVec3f rot = cam.getOrientationEuler();

    cam.begin();

    ofNoFill();
    ofSetColor(255);
    ofDrawBox(25);

    ofPushMatrix();
    ofTranslate(2, 2);
    ofRotateX(rot.x);
    ofRotateY(rot.y);
    ofRotateZ(rot.z);
    ofFill();
    ofSetColor(255, 0, 0);
    ofDrawCircle(0, 0, 0, 2);
    ofPopMatrix();

    cam.end();
}

Posts: 3

Participants: 2

Read full topic

Running Stepper Motors with ofArduino

$
0
0

@Charles_Lucien wrote:

Hi All,

I've got standard firmata loaded on my Arduino which I'm controlling in OF, however to move my steppers I need to set a delayMicroceconds() between the HIGH and LOW calls.

It seems this functionality isn't available in ofArduino. Can someone point out a workaround?

Here's the arduino code which moves the motor by 400 steps:

for (int x = 0; x < 400; x++) {
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(350);
}

Thanks in advance,
Charles

Posts: 2

Participants: 2

Read full topic

Is it possible to add markers on map in ofxMaps

Which Kinect model and operating system for easiest use of Kinect with openFrameworks?

$
0
0

@fooness wrote:

Dear community,

unfortunately I didn’t find a definitive answer which is not older than almost one year … it seems Kinect v2 is still not officially supported by ofxKinect, is this correct?

So I just wanted to ask you experts, as I never used a Kinect by now, which Kinect model I should get and if it’s totally fine to use it with macOS, or if I should use it with bootcamp windows (10?) or even with a real windows laptop …

I’d like to use the Kinect to measure the speed of a body’s motion and maybe the distance to the camera (for now) …

Thank you very much!

PS: I’m also not sure if I need a power supply for Kinect (for xbox 360) when using it with my MacBook Pro …

Posts: 2

Participants: 2

Read full topic

I want to hide the title bar of the window


Maximilian C++ Lib

$
0
0

@Ulonix wrote:

Hi,
I'm new to this forum, and this is the only place I've found references to the Maximilian Audio library.
Actually I'm not using openframeworks, but I'm trying to run the basic examples of Maximilian on Xcode but in the output I'm seeing this:

RtAudio: no compiled support for specified API argument!
RtApiDummy: This class provides no functionality.
No audio devices found!

I think it's a config issue of my project, because when I run the built-in Xcode "maximilianTest" project, I do not get that error.
I'm really trying to learn by building my own project and get to know this library

Thanks

Posts: 1

Participants: 1

Read full topic

Getting triangles out of an ofxAssimpModelLoader object

$
0
0

@edapx wrote:

Is there an easy way to get all the triangles (the position of the 3 vertices) out of an instance of an ofxAssimpModelLoader?
Or the only way is to get the mesh, read the indexes and the vertices and then compose the triangles?

Posts: 2

Participants: 1

Read full topic

Transmission of characters

QT Creator not letting me set compiler for Desktop Kit

$
0
0

@dimadira wrote:

Hello, I followed the steps to use QT Creator with msys2 and OF. I added the compilers in QT Creator but when I go to the "Kits" tab, the Desktop Kit doesn't allow me to set a compiler. What can I do?

Posts: 1

Participants: 1

Read full topic

Find intersection of a ray with a 3Dprimitive

$
0
0

@edapx wrote:

I'm trying to use this method https://glm.g-truc.net/0.9.0/api/a00162.html in order to find the intersection between a ray (with origin X and direction wi) and a mesh. The problem that I'm having now is to convert the position of the vertices of the 3d primitive, in this case a box, to global space.

This is my code

ofColor RayCaster::L_i(const glm::vec3& X, const glm::vec3& wi) const {
     // for all the triangles in a mesh
     // Find the first intersection (and the closest!) with the scene
    glm::mat4 globalTransfMatrix = this->box.getGlobalTransformMatrix();
    vector<ofMeshFace> faces = this->mesh.getUniqueFaces();
    bool found = false;
    for(ofMeshFace face : faces){
        glm::vec3 baricenter;
        found = glm::intersectRayTriangle(X, wi,
                                          face.getVertex(0) * globalTransfMatrix,
                                          face.getVertex(1) * globalTransfMatrix,
                                          face.getVertex(2) * globalTransfMatrix,
                                          baricenter);
        if (found) {
            break;
        }
    }

   // black and white debug
    if (found) {
       return ofColor(255,0,255);
    } else {
       return ofColor(0,0,0);
    }
}

The error that I'm having is
"
Use of overloaded operator '*' is ambiguous (with operand types 'const glm::tvec3' and 'const glm::mat4' (aka 'const tmat4x4'))
"

I've already tried to multiply a glm::vec4 for glm::mat4, but in this case I was having another error, saying that the signature of the method is not correct.

Any Ideas?

Posts: 2

Participants: 2

Read full topic

projectGenerator from the command line

$
0
0

@clem wrote:

I'm working on an app which has too many addons for projectGenerator to cope... PG throws "There was a problem generating your project... stdout maxBuffer exceeded"

I'm using the latest OF and projectGenerator on a macOS 10.12.6.

I don't seem to have that issue using the command line version.

In case anyone else has to do this, here's what I do to make adding and removing addons a bit less painful :

1 - I update my app's addons.make file with all the addons I want to use then, with the help of this alias in my .bashrc :

alias ofxpg="~/workspace/openFrameworks/apps/projectGenerator/commandLine/bin/projectGenerator -o\"~/workspace/openFrameworks\" -p\"osx\""

2 - I can do this from anywhere:

ofxpg folder/for/my/App

or if I'm in my app's folder then:

ofxpg .

Posts: 1

Participants: 1

Read full topic

Can't allocate ofFbo via Emscripten

$
0
0

@chuckleplant wrote:

I can render ofImages, however I cannot do this:

    ofFbo fbo;
    fbo.allocate(100,100,GL_RGBA);`

Here's a minimal (non) working example

FBOEmscripten.zip (10.8 KB)

The error shows:

exception thrown: abort(5) at Error
    at jsStackTrace (http://localhost:6931/fboEms.js:1:23216)
    at stackTrace (http://localhost:6931/fboEms.js:1:23387)
    at abort (http://localhost:6931/fboEms.js:36:170505)
    at Array._8b (http://localhost:6931/fboEms.js:29:116330)
    at waa (http://localhost:6931/fboEms.js:17:97076)
    at uaa (http://localhost:6931/fboEms.js:17:93500)
    at Array.Ze (http://localhost:6931/fboEms.js:5:864)
    at Array.of (http://localhost:6931/fboEms.js:5:1579)
    at Array.i9 (http://localhost:6931/fboEms.js:17:63744)
    at Ij (http://localhost:6931/fboEms.js:5:59937)

Right at

Posts: 1

Participants: 1

Read full topic


Since I want to draw more than 10000 font textures, how to write that shader

$
0
0

@taketori7616 wrote:

I'd like to draw more than 10000 font textures, so I would like you to tell me how to write that shader.

setup

ofVboMesh vboMesh;
myFont.load("Futura.ttc",8,true,true,true,0.5,1000);
vboMesh = myFont.getStringMesh("taketori", 0, 0);

draw

myFont.getFontTexture().bind();
vboMesh.draw();
myFont.getFontTexture().unbind();

I want to draw plenty of textures of fonts written like this, but if you do with 1000 CPUs, FPS will go down if you draw 1000 pieces.
So, is there a way to draw textures to the shader to draw over 10000?

Since GLSL is a beginner, please tell me in detail.

Posts: 2

Participants: 1

Read full topic

ofxPanel : change default settings file

$
0
0

@Gallo wrote:

hello,

I know it is possible to change the default settings file where settings are stored when clicking the disk icon in ofxPanel when using ofxPanel::setup().

But is it possible to change it afterwards ?

What i need is to load settings and see if an option "save localy" is on or off and change the save file name accordingly.

Hope i am clear enough...

thanks

Posts: 1

Participants: 1

Read full topic

Maximum IR depth length?

$
0
0

@Kit_Webster wrote:

Does anyone know which camera has the max IR depth? Im looking to track a human in 3D but I need to place the camera around 7m distance from the subject. Is this even possible?

Posts: 1

Participants: 1

Read full topic

osxVideoRecorder cuts off the end

$
0
0

@michif wrote:

Hello
I work with the osxVideoRecorder and have a strange issue: it cuts the last bit of the recorded video. sometimes this is even about 1 sec. somtimes it seems like it adds that part to the beginning of the recorded file. i experience that also in the osxVideoRecorderExamples. What did i do wrong? any suggestions? i am on Sierra and tried it with the buid in facetime camera. i also tried logitech c920. it seems that it is worse with the logitec, but i am not quite sure about that. thanks, michael

Posts: 1

Participants: 1

Read full topic

Get global vertices position of an instance of ofxAssimpModelLoader

$
0
0

@edapx wrote:

Hello, I've loaded a model and I've changed the position and the rotation of it inside my scene.

Now I need to find the global position of the vertices of the meshes contained in the model. Is there a way to have the global transofrmation matrix? like getGlobalTransformMatrix im 3DPrimitive ?

Posts: 2

Participants: 1

Read full topic

Viewing all 4929 articles
Browse latest View live