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

Example files not running

$
0
0

@jlyjn wrote:

howdy,

am having trouble running any of the basic examples like 3d primitives under osx 10.12.5 and Xcode 8.3.3
the error highlighted is:

bool ofAppGLFWWindow::getWindowShouldClose(){
return glfwWindowShouldClose(windowP);
}

none of the example files/executables run under either of_v0.9.7 or of_v0.9.8
has anyone else run into this?
please help!

Posts: 1

Participants: 1

Read full topic


I'm in trouble with set the Android Studio project

$
0
0

@sfty920327 wrote:

Hi, everyone.
I'm beginners at OF and I want to devolop wonderful project with OF.
I had some trouble to setup the android studio project with OF.
I just want to run the simple project, but there is the message like this.
'CreateProcess error = 2, The system cannot find the file specified'

How can I solve this problem?

Posts: 1

Participants: 1

Read full topic

How to bind ofFbo texture to a 3d object?

$
0
0

@cuinjune wrote:

Hi, I'm trying to draw a red circle into a fbo and then use it as a texture for a box shape.

I tried the below code and fbo.draw() works fine but I could not bind the texture into a box.

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

    fbo.allocate(200, 200, GL_RGBA);

    fbo.begin();
    ofClear(255, 255, 255, 150);
    ofSetColor(ofColor::red);
    ofDrawCircle(100, 100, 100);
    fbo.end();

    ofDisableArbTex();
    ofEnableDepthTest();

    mesh = ofMesh::box(200, 200, 200);
}

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

}

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

    fbo.draw(0, 0);

    ofTranslate(ofGetWidth()/2, ofGetHeight()/2);

    float degrees = ofGetElapsedTimef()*10;

    ofRotateX(degrees);
    ofRotateY(degrees);
    ofRotateZ(degrees);

    fbo.getTexture().bind();

    mesh.draw();

    fbo.getTexture().unbind();
}

What is wrong with my code?
Thanks in advance.

Posts: 5

Participants: 3

Read full topic

Trouble: KeyPressed/KeyReleased in other class

$
0
0

@Taconito wrote:

I create a class "Ball" . In this I created the "Ball :: keypressed" and "Ball :: keyReleased" methods. Ex....

void Ball::keyPressed(){
      if(key== OF_KEY_RIGHT){
            right += 5;
        } else if (key== OF_KEY_LEFT){
           left -= 5;
        }

I would like to make them run with the keys, calling them directly from ofApp. Ex:

void ofApp::keyPressed(int key){
      Ball.keypressed();
      }

I have no idea how to do it. Can someone help me?

Posts: 4

Participants: 2

Read full topic

Drawing in custom shader is half scaled

$
0
0

@Philippe_Charest wrote:

When drawing with a custom shader everything drawn in the shader is half scale... or drawing outside the shader everything id double scale....

If I call th of drawing function between shader calls the scale is what is expected!

cam.begin();
myCube.draw();  //This calls a custom shader and draws instanced cubes
ofSetColor(255, 0, 0);
ofDrawLine(0, 0, 0, myCube.ledSpacing * 15, 0, 0);
ofSetColor(0, 255, 0);
ofDrawLine(0, 0, 0, 0, myCube.ledSpacing, 0);
ofSetColor(0, 0, 255);
ofDrawLine(0, 0, 0, 0, 0, myCube.ledSpacing);
ofDrawArrow(ofVec3f(0, 0, 0), ofVec3f(0, 0, myCube.ledSpacing), 3);
cam.end();

In the screen grad the redline is suppose to be the same width as the cube....

file:///home/phil/Desktop/Screenshot%20from%202017-09-15%2021-54-23.png

Posts: 2

Participants: 1

Read full topic

Particle emitter on sphere mesh

$
0
0

@Roflmagoo wrote:

Hello everyone,
I'm a newbie in the Openframeworks world, and I'm trying to set some particles emitter from the surface of a simple sphere mesh, using the vertices: how can I do that?

Thanks for your support!

Alessandro

Posts: 1

Participants: 1

Read full topic

Artnet troubles windows 10?

$
0
0

@mtthw_jhnsn wrote:

Hey OF forum,

Attempting to get Artnet functionality working for a project, has anyone had success on windows 10? With the ofxArtnet addon I get a console error message "[ error ] node is not found "

Tested with firewalls disabled as recommended. Was able to successfully get artnet working using MadMapper.

Any help would be appreciated.

Thanks

Posts: 1

Participants: 1

Read full topic

Can OF draw a 3d primitive with hidden lines as dotted line?


oF + Qt + Windows10 : error on starting a new project

$
0
0

@joeseeba wrote:

Hi,
I installed oF + mysys2 and Qt with QtCreator on a new Windows 10 pc exactly the same way I did some monts ago on the old one.
On the old pc everything works fine.
On the new one I can succesfully recompile and execute a project I already developed on the old pc.
But if I start from scratch a new project in the new pc from QtCreator->File ->New File or Project->openFrameworks and then correctly setup project path, oF library folder and addons, I get an error from the editor.
In the sidebar a new .qbs project is actually started but I get this message:

! Cannot lock build graph file 'C:/Users/info/OneDrive/Dokumente/Error in " Util.asciify("build-untitledTEST-Desktop-Debug")": TypeError: Property 'asciify' of object Core::Internal::UtilsJsExtension(0x737eb88) is not a function/qtc_Desktop_94451bc9-debug/qtc_Desktop_94451bc9-debug.bg': Failed to create directory.

And obviously can't start the new project because except.qbs file everything else is missing and the error completely locks the editor.

Anyone have some ideas about what does it mean and how can be fixed?

Of course for now I can take an old project, copy and rename it, set the new paths, clear the source files and use it as starting point for new projects, but... you know!

Thank you in advance!

Posts: 2

Participants: 1

Read full topic

Water color shader

$
0
0

@Regi wrote:

Hi,

I've been looking for a water color shader implementation exampe or some guidance on how to achieve a similar effect. I'm planning to have a mouse-follower (simple brush) based interaction in the end. Unfortunately google hasn't been very rewarding so far.

An ideal visual representation for me would be something like this:

All help appreciated!

Posts: 2

Participants: 2

Read full topic

Sending vec2 data to fragment shader

$
0
0

@Hideki_Eguchi wrote:

////////////
fragment shader
////////////
uniform vec2 data[64];

////////////
oF Code
////////////
ofVec2f sendData[64];
for (int i = 0; i < 64; i++) {
sendData[i] = ofVec2f(0.0, 0.0);
}
shader.setUniform2fv("data", sendData, 64);

An error occurred!!
Could you tell me how to send vec2 array?

Posts: 1

Participants: 1

Read full topic

FBO + 3D Particle System

$
0
0

@Roflmagoo wrote:

Hello,
In my project I have a rotating sphere, an ofEasyCam and a series of particle emitters on the surface. I want to draw the "trail" of the particle, like on the 2D example, with ofFbo: what's the best way to use it? I have done little experiment, but it was all terribly wrong.

Thanks for your help!

Posts: 2

Participants: 2

Read full topic

Loading images from a web folder

$
0
0

@TimChi wrote:

Hi all,

I'd like to load a group of .jpg files from a single folder on the web. Does anyone have any suggestions for this? I've tried and failed with ofDirectory and a path like "http://myWebSite.com/myImageFolder", though it works great for any folder on my system drive. I've successfully used ofURLFileLoader for a single file (like in the graphics example), but not for a group of them in a folder (assuming that their names are unknown at compilation). And image.load("http://myWebSite.com/myImageFolder/myImage.jpg") works just fine, but this approach also requires that the file names are known ahead of time, rather than being deduced from the actual contents of the folder. Perhaps there is an addon for this task? Any help is greatly appreciated and thanks a bunch!

Tim

Posts: 1

Participants: 1

Read full topic

Drawing pixels on a background

$
0
0

@Jipolie01 wrote:

Hi guys,

I'm using a text document to make a vector of colors. Now I want to print these colors in blocks of 5x5 pixels.
This makes a zoomed in version of the individual pixels that I can compare to my LED-matrix. I've researched for quite a while but can't seem to find a way to do this. Does anyone know how to do this?

Thanks!

Posts: 1

Participants: 1

Read full topic

How to tell when ofxThreadedImageLoader is done loading

$
0
0

@teganscott wrote:

Hello all!

I am using ofxThreadedImageLoader to load a series of images on demand several times throughout my project. Does anyone have ideas or could point me in the right direction to tell when ofxThreadedImageLoader is finished loading? The thread seems to never stop running, even after the images are loaded.

Posts: 1

Participants: 1

Read full topic


Copy a string to the clipboard?

$
0
0

@cuinjune wrote:

Hi, I wonder if there's any OF class that can copy a string to the clipboard which can be pasted outside of OF program.
Thanks!

Posts: 3

Participants: 2

Read full topic

Spinning twirling circles in youtube vid

$
0
0

@80l08 wrote:

I found this clip on youtube yesterday and I'm dying to know how its made:

Circle Variations by Perlin Noise

Any clues on how to make something similar? I've drawn circles with tangents, etc. from the ofBook but its really the slow rotations and circle trails that are catching my n00b eye.

thanks ^.^

Posts: 1

Participants: 1

Read full topic

Embedded browser in openframeworks Windows VS

$
0
0

@dasoe wrote:

Hi all,

I am working on embedding a browser into OF app, which seems a smart way of integrating the easy layout possibilities of HTML in an OF-powered app. I searched for quite long, and like to share my experience. I hope you people do share yours:
(All is windows VS, which is a requirement for me I am afraid)

  • ofxAwesomiumPlus was quite easy to include. It works rather well and seems stable. Still checking on this, I'll update if I know more. Big drawback of using Awesomium is that the webpage of Awesomium is gone for quite a while. Wiki still exists, but I do not know if Awesomium is still maintained. Some people say it's dead? Anyone knows hard facts?
    Also, as far as I know there is no 64 bit version.
  • ofxCef. I found some quite up to date forks (and a lot of posts on the topic) but did not succeed in compiling the example yet (although compiling cef itself seems to have been successful). I'll look further into this and eventually update this - but I'd appreciate your experience.

Is there other possibilities working with windows? What is confusing me it that many posts on the topic I found are rather old and it is difficult to find up-to-date information. Do I miss something? Or is it just of minor importance for most of you? For my industry this would be a major feature.

Thanks all & have a great day!
oe

Posts: 1

Participants: 1

Read full topic

Working example for ofTrueTypeFont::getStringAsPoints?

[ofTTF]How to accurately find the center position of each letter

$
0
0

@cuinjune wrote:

Hi, I'm trying to find the center x,y position of each drawn letter.

For example, if I draw "Hello" on the screen, I want to find out 5 different positions that points to center of each character.

I tried to simply get the bounding box of the text and divide it by the number of letters but it doesn't seem to be accurate enough.

Here's my test code.

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

    ofSetBackgroundColor(255);
    font.load("/Users/cuinjune/Library/Pd/ofelia/DejaVuSansMono.ttf", 30);
}

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

}

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

    string text = "Hello World";

    ofSetColor(0);
    font.drawString(text, 100, 100);

    ofNoFill();
    ofSetColor(255, 0, 0);

    ofRectangle bb = font.getStringBoundingBox(text, 100, 100);
    ofDrawRectangle(bb);

    float startingX = bb.x;
    float startingY = bb.y;
    float letterWidth = bb.width / text.length();
    float letterHeight = bb.height;

    for (int i=0; i<text.length(); ++i) {

        ofDrawRectangle(startingX + (i*letterWidth), startingY, letterWidth, letterHeight);
    }
}

And this is the result.


But as you can see, the letters are not evenly distributed so my method isn't really accurate.

Any idea how to do it more accurately?

Thanks in advance!

Posts: 1

Participants: 1

Read full topic

Viewing all 4929 articles
Browse latest View live


Latest Images