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

ofSoundBuffer &outBuffer multiple outputs

$
0
0

@antocreo wrote:

Hi everyone,
I have made a class out of the basic SoundBuffer example from OF0908 that is called Pulse.
What I am trying to do is to create an array of Pulse that plays in the main ofApp with different settings.
I managed to make one Pulse object sound but if I create an array or just 2 separate objects I can hear no sound.

here is the code in my ofApp

void ofApp::audioOut(ofSoundBuffer &outBuffer) {

   for ( int j=0; j<NUM_SENS; j++ ) {
        myPulse[j].audioOut(outBuffer, 100 * avrgRMSAcc , lastSens, avrgRMSSens);      //this dowsn't work
            }

    myPulse1.audioOut(outBuffer, 100 * avrgRMSAcc, lastSens, avrgRMSSens);        //this is working ok alone
}

Any idea anyone?

Cheers!

Posts: 1

Participants: 1

Read full topic


Getting a texture reference from the ofVideoPlayer

$
0
0

@rich7886 wrote:

Hello I had an old project that used a video to deform a mesh from getting a texture reference from the ofVideoPlayer.

This doesn't seem to work anymore, My video plays but when I tried to getTexture nothing seems to come from the video.

vid1 = new ofVideoPlayer();
vid1->load("gridFilmNew.mov");
//    vid2.load("gridFilmNew.mov");

vid1->play();

ofTexture test = vid1->getTexture();
plane.mapTexCoordsFromTexture(test);

i get this error: ofTexture: getTextureData(): texture has not been allocated

It worked before using an older version and getTextureReference(); any ideas?

Thanks,
Richard

Posts: 1

Participants: 1

Read full topic

How do I move the camera/window?

$
0
0

@robotmad50 wrote:

Say you have a picture of a massive smiley face that is greater than the size of your window. Is there a way/function call that allows me to move the camera so that I can see the other parts of the smiley face as they come into view?

I apologize if the question is too vague.

Posts: 5

Participants: 2

Read full topic

Addon with Eclipse-CDT doesn't work

$
0
0

@Courant_de_Fuite wrote:

Dear all,

I would like to use OF (Wonderfull software) within Eclipse-cdt under Linux Debian Jessie (3.8).
I followed the tutorial on your website to integrate the OF plugin to Eclipse (v-3.8.1), no problem.
The problem is when I create a new project in my workspace, the button "next" in Eclispe doesn't let me add the addons.

How can I solve this kind of problem please ?

Thanks for your help and support.

Regards,

Chris.

Posts: 3

Participants: 2

Read full topic

DXF polylines / ofxAssimpModelLoader

$
0
0

@dimitre wrote:

hello, is it possible to import a centerline geometry (just polylines, without faces) using ofxAssimpModelLoader?
Thanks

Posts: 3

Participants: 2

Read full topic

Recording and Playing back audio soon after

$
0
0

@dimitre wrote:

I'm trying to find a way of recording audio input and soon after play it back, change speed, reverse, etc.
In fact it would be great to load an ofSoundPlayer with ofSoundBuffer data.

my first approach was to create an empty ofSoundBuffer and append it while recording, but no idea how to play it back and transform the sound. any advices?
Thank you

void ofApp::audioIn(ofSoundBuffer &inBuffer) {
	if (recording) {
		rec.append(inBuffer);
	}
	cout << rec.getNumFrames() << endl;
}

Posts: 4

Participants: 2

Read full topic

Is it possible to an object send a value outside its class?

$
0
0

@jbacelar wrote:

Hi!

I have some classes of objects always been updated from cycles in the App.
I need to get some string values that are added inside the objects.

Is it possible to get these string values in ofApp?

Thanks.

Posts: 3

Participants: 3

Read full topic

HDMI input Raspberry PI3 to PIMapper application

$
0
0

@Steve_Rodriguez wrote:

Could anyone help me with setting this up? I've got a rasberry pi3 with OF installed, still figuring out how to put PiMapper on it, but once I'm able to do that it just seems like I might not be able to have an hdmi input routed as a source or I don't know how to make it one. I want to mirror an iPad app to a video mapped projector. I would highly appreciate any pointers as I'm fairly new to both the raspberry pi and OF in general. Just bought one for this project to see if I can make it work for a relatively inexpensive price point. Thanks

Posts: 2

Participants: 2

Read full topic


How can I have to play the any movie file with alpha channel on ubuntu distribution?

$
0
0

@ayafuji_ wrote:

Hello,

On ubuntu 16.04, I've been trying to play a movie which has alpha channel.
But it seems that it would not work fine.

I tried

player.setPixelFormat(OF_PIXELS_BGRA);

but could not.

How can I have to play the any movie file with alpha channel on ubuntu ?

Posts: 2

Participants: 2

Read full topic

How do I draw a single point and affect its thickness?

$
0
0

@laziemo wrote:

How do i create a single point in oF and set its thickness?
ofPoint doesnt work and ofVertex doesnt display the point.

the equivalent of what I'm trying to achieve in processing is:

background(0);
stroke(255);
strokeWeight(10);
point(500,500);

Additionally is there anyway I can connect these two points to create a line - for example if im trying to plot points of a graph?

Cheers!

Posts: 6

Participants: 3

Read full topic

String size or length?

$
0
0

@s002 wrote:

Hi!
I am trying to translate from processing to openframeworks and almost there ,
except I can not get the size of the string after I input the string into a function
work in draw ()
string sen("Merry");
ofDrawBitmapString(sen.size(),100,300);
will return 5 on screen

but then I call a function:
algo( sen,"",1);
which is declared
string ofApp::algo(string sen, string res, int iteration){
float l = sen.size();

}
then when I debug , to have a look at sen.size is equal to 0.000000000000000000000000000000000000130693749 !!!

must be a real beginner bugs, but I have been spending all morning on this !!!!
many thanks for helping me .
PS
appears that sen.length is working
but I have still a question about testing it :
if (sen.length()==0) {.......}
does not work when there is nothing more in the string?
How can I test there is no more character in the string?
Many thanks

Posts: 1

Participants: 1

Read full topic

Creating a score in a game

$
0
0

@thedasher wrote:

im using openframeworks through code blocks and i have my game running and was wondering how to get a score setup where it shows up on the screen starting at 0.
thanks

Posts: 1

Participants: 1

Read full topic

ofxDatGui safely remove GUI components

$
0
0

@NzNico wrote:

Hi !

I'm making a verry flexible interface that adapts to an xml hierarchy. There for, I tried to find some delete method for a parent gui container. I can use "delete" on the adresse of a button, but I don't want the parent to have pointers on deallocared memory parts when I ask for the existing childrens.

Is there any way to remove components from their parent safely ?

Thanks :slight_smile:

Posts: 1

Participants: 1

Read full topic

Beginner questions about events

$
0
0

@Awareness wrote:

I subclass ofxButton and then I want to call a xbutton class' function if the user clicks on an instance of this button:

xbutton.h:

class xbutton : public ofxButton
{

  public:

    bool mouseMoved(ofMouseEventArgs & args);
    bool mouseDragged(ofMouseEventArgs & args);
    bool mousePressed(ofMouseEventArgs & args);
    bool mouseReleased(ofMouseEventArgs & args);
    bool mouseScrolled(ofMouseEventArgs & args);
    void mouseEntered(ofMouseEventArgs & args);
    void mouseExited(ofMouseEventArgs & args);


    void mousepressedj();

}

in ofApp.h:

ofxButton edit[10];
xbutton editb;

In ofApp.cpp:

void setup()
{
 editb.addListener(this,&ofApp::editPressed);
 edit[0].addListener(this,&ofApp::editPressed);
}

When I click on edit[0] button, it calls ofApp::editPressed function without problem.But when I click on editd button, it doesn't call ofApp::editPressed function.Why?

Also, how can I call the function xbutton::mousepressedj when the user clicks on editb button?When I write in ofApp.cpp:

editb.addListener(this,&xbutton(or &edit0)::mousepressedj);

it gives the error:

C:\openframeworks\addons\ofxGui\src\ofxButton.h:21: error: no matching function for call to 'ofAddListener(ofEvent<void>&, ofApp*&, void (xbutton::*&)())'
   ofAddListener(triggerEvent,listener,method);
            ^

Posts: 2

Participants: 2

Read full topic

Favorite ways to optimize workflow?

$
0
0

@aceslowman wrote:

I'm curious how different people work with openframeworks, and in what different ways you have all tweaked your workflow to make it more efficient. Maybe it's something you learned for Xcode, some addon, or something like an IRC group that you found helpful.

I'd also love to hear if there was one tool or technique that you found that really improved your work.

Really open ended question, just hoping to find something new to mix up my stagnating setup.

Posts: 3

Participants: 3

Read full topic


Application running

$
0
0

@massimiliano wrote:

Is possible implementing a OF project that run as a service/daemon/background, or console mode ?

In GUI mode is possible draw some things only one more time or only when i needed to draw ?

Posts: 1

Participants: 1

Read full topic

OF Logo on some deploy platform

$
0
0

@massimiliano wrote:

When I compile project for emscriptem, iOS or Android, after launch application first appear OF Logo.

Is possibile to remove from compilation of an OF Project ?

Posts: 1

Participants: 1

Read full topic

How to move a image (ofImage) to a new position?

$
0
0

@ibrahim313 wrote:

how to move a image (ofImage) to a new position and if it intersects with another image then the other image would disappear like in chess.

Posts: 2

Participants: 2

Read full topic

How to use ofxOpenNI for skeleton tracking

$
0
0

@oh47 wrote:

Hello, i use xbox 360(kinect) and i already installed openni, nite-win32, sensorKinect program.

Then i search some source codes to use kinect for skeleton tracking.

https://github.com/roymacdonald/ofxOpenNI

testApp.h

ifndef TESTAPP

define TESTAPP

include "ofMain.h"

include "ofxOpenNI.h"

class testApp : public ofBaseApp{

public:
void setup();
void update();
void draw();

void keyPressed  (int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);


bool				isMasking;

ofxOpenNIContext	mContext;
ofxDepthGenerator	mDepth;

ofxImageGenerator	mImage;


ofxUserGenerator	mUser;

if defined (TARGET_OSX) //|| defined(TARGET_LINUX) // only working on Mac/Linux at the moment (but on Linux you need to run as sudo...)

ofxHardwareDriver	hardware;

endif

void				drawMasks();

int					nearThreshold, farThreshold;

ofImage				allUserMasks, user1Mask, user2Mask, depthRangeMask;

float				filterFactor;

};

endif

But in this code their are some types like (ofxOpenNIContext, ofxDepthGenerator, ofxImageGenerator, ofxUserGenerator) are not in the "ofxOpenNI.h".

So i do not know what can i do to solve this problem.

I want skeleton tracking and get world coordinate(x, y, z) about head and hand.

If do you have some idea which solve it, please teach me.
Thank to read my sentences!

Posts: 1

Participants: 1

Read full topic

Why is the model matrix rotated around Z in ofxAssimpModelLoader::updateModelMatrix()?

$
0
0

@ttyy wrote:

Question is referring to line 497 in ofxAssimpModelLoader.cpp:

void ofxAssimpModelLoader::updateModelMatrix() {
    modelMatrix.makeIdentityMatrix();
    modelMatrix.glTranslate(pos);
    modelMatrix.glRotate(180, 0, 0, 1); // <----------- this line
    if(normalizeScale) {
        modelMatrix.glScale(normalizedScale , normalizedScale, normalizedScale);
    }
    for(int i = 0; i < (int)rotAngle.size(); i++){ // @julapy - not sure why rotAngle isn't a ofVec4f.
        modelMatrix.glRotate(rotAngle[i], rotAxis[i].x, rotAxis[i].y, rotAxis[i].z);
    }
    modelMatrix.glScale(scale.x, scale.y, scale.z);
}

If I comment out line 497, getSceneMin(), getSceneMax(), and getSceneCenter() return values that correspond to the onscreen model location/dimensions.

Otherwise those values are rotated 180 around Z compared to the model.


model and calculated bounding box

after removing line 497 vs. before

Posts: 1

Participants: 1

Read full topic

Viewing all 4929 articles
Browse latest View live