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

Dashed lines in Openframeworks

$
0
0

@asyed228 wrote:

Is it possible to draw dashed lines or dotted lines in Visual Studio 2015 using Openframeworks?!
Thanks in advance!

Posts: 1

Participants: 1

Read full topic


Info openframeworks glm

$
0
0

@kashim wrote:

Hi all,

there is a release of openFrameworks that implements GLM? or am I wrong?
perhaps the dev?

thanks and good day
Dario

Posts: 4

Participants: 2

Read full topic

I'm very beginner. i want to make game playing time

$
0
0

@h5olo wrote:

hi :slight_smile: i want to know about make timer for timelapse.
first, what i want to know is using ofGetElasedTimeMillis
or any time controler to control mygame's playing time to set 60seconds.
second,in this 60 seconds some events(like blink) occur 10 times in random seconds..
// 1sec blink
// 10sec blink
// 14sec blink
// 20sec blink
// 38sec blink ... 10 times

//what should i do first.. ?:sweat:

Posts: 1

Participants: 1

Read full topic

Increase the size and change color of text

$
0
0

@asyed228 wrote:

Hello all,
How can i increase the size of my text and change their color too?? I used ofgetBitmapString to create text. Or is there a better function to use?
Thanks!

Posts: 2

Participants: 2

Read full topic

Proper use of translate,rotate in ofPath

$
0
0

@cuinjune wrote:

Hi, I just figured out calling translate or rotate BEFORE setting the path doesn't have any effect.
It was only effective when translate, rotate were called after setting the path (e.g rectangle)

For example, when I write

void ofApp::draw(){

ofPath path;
path.translate(ofPoint(100,100,0));
path.rectangle(0, 0, 100, 100);
path.draw();

}

It draws a rectangle at (0,0) so it doesn't get translated.

but when I set rectangle path first and then translate it like below,

void ofApp::draw(){

ofPath path;
path.rectangle(0, 0, 100, 100);
path.translate(ofPoint(100,100,0));
path.draw();

}

Now it properly draws a rectangle at (100,100)

Is this a normal behavior of ofPath?
I think it's a bit confusing to use since ofTranslate and ofRotate gets called before drawing any shape to have an effect.
Could someone please explain why the order is opposite in ofPath? Thank you :slight_smile:

Posts: 2

Participants: 1

Read full topic

Kalman Filter implementation vector dimension

$
0
0

@fabio-C wrote:

I want to implement Kalman filter with OF.
I want to do a general purpose sketch or class, so the input state vector could be 2, 4 o 10 dimensional. And I need matrix operations.
But in OF there are only ofVec2 and ofVec3.

How can I manage vector and matrix dimension bigger than 3?

Posts: 1

Participants: 1

Read full topic

Fullscreen and coordonates questions in GL context

$
0
0

@christoph wrote:

Hello, i m discovering with great pleasure OpenFrameworks.

actually i m making some tests on a Surface Pro w10 wich is 2736x1824

compiling with VS 2015 Studio v 098, in fullscreen mode, no problem.

the app appears in FScreen and coordonates x and y are ok.

But if i set my screen in another resolution the fullscreen disappears, and the window is truncanated and not at all FScreened.

here is a snapshot in resolution 1920x1080 and below the code used to intitalize the window

is there anything i m missing ? thxs

void ofApp::setup(){

	ofSetWindowTitle("...");
	ofSetWindowShape(1920, 1080);

}

int main( ){
	ofSetupOpenGL(1920,1080,OF_FULLSCREEN);			// <-------- setup the GL context

	// this kicks off the running of my app
	// can be OF_WINDOW or OF_FULLSCREEN
	// pass in width and height too:
	ofRunApp(new ofApp());

}

Posts: 1

Participants: 1

Read full topic

Help with face recognition - ofxCvFaceRec

$
0
0

@ch3 wrote:

Hello openframeworkers!
Just a few days ago I convinced my self to dive into the amazing world of OpenFrameworks with a project in mind.

I want to track and recognize faces from the webcam, so I am looking around for libraries and example code to try out before the actual implementation. I've already managed to track faces both using the ofxOpenCv addon as well as ofxCv which seems to be faster and as far as I read better to use this than the first. (is that right you think?)

Moving on with a basic face recognition test, I manage to get some results by copy pasting code from this example project into mine .

With further looking online, I came across this class which seems to be a nicer approach. But correct me if I am wrong, it seems that this was written for an older version of openframeworks, or VisualStudio and it can't compile. It doesn't even have a ofApp.cpp file. Why is that?

I may be missing something fundamental here, but I am still trying to figure out how things work with visualStudio, c++, openframeworks and how to bring in additional libraries.

What do I need to do to add it to my project, or even run the testApp that comes with it?
Or is there maybe another easy to use class/library to consider using?

thank you

Posts: 2

Participants: 1

Read full topic


"true" location of ofPoint after transformations with ofPushMatrix

$
0
0

@Luke_Zeitlin wrote:

is there any simple way to retrieve the actual location, as it is drawn to the screen, of a ofPoint that has been defined after a series of transformations using ofPushMatrix?

I want to use the point to draw to an an fbo, but it's .x and .y values are relative to the transformations of the last pushed matrix.

Here is why I want it, for clarification. This class is recursive and I want the point at m_nextAxis at the end of the chain in order to draw it to an fbo.

Circle::Circle(ofPoint axis, double rad, int hz, int numberOfCircles, float radDivisor)
: m_axis(axis), m_rad(rad), m_hz(hz), m_numberOfCircles(numberOfCircles), m_radDivisor(radDivisor)
{
    m_circleNumber = counter++;
    m_nextAxis = ofPoint(0, m_rad);
    ofPushMatrix();
    ofTranslate(m_axis);
    ofRotateZ(ofGetFrameNum());
    makeCircles();
    ofPopMatrix();
}

void Circle::makeCircles()
{
    ofCircle(0, 0, m_rad);
    ofLine(0, 0, 0, m_rad);

    if(m_circleNumber < m_numberOfCircles - 1)
    {
        Circle(m_nextAxis, m_rad / m_radDivisor, 10, m_numberOfCircles, m_radDivisor);
    }
    else if(m_circleNumber == m_numberOfCircles - 1)
    {
        ofCircle(m_nextAxis, 3);
    }
}

Posts: 1

Participants: 1

Read full topic

Multitouch windows

$
0
0

@christoph.visualarts wrote:

Hello
By check-up the gui on a surface pro i see its not multitouch
I m in néed of créating à user interface multitouch
How can this be achieved? What is the Best way to write an app with multiples points ?

Thanks à lot

Posts: 6

Participants: 3

Read full topic

App Buttons with left mouse & TAP action

$
0
0

@massimiliano wrote:

When you must select an option of your application you can for example create a rectangle that when mouse is inside and you click with left button do something.

This scenario is valid for desktop application .

On mobile device with touchscreen where you "tap" to select something is possible programming same thing by using the same code of mouse ?

Posts: 1

Participants: 1

Read full topic

Help using ofCairoRenderer

$
0
0

@on4now4 wrote:

ignoring all the pre-written stuff I have added these few lines of code to my project:

ofApp.h:

 ofCairoRenderer flightAngle;

ofApp.cpp:
under the draw section:

ofFill();
flightAngle.setCircleResolution(50);
flightAngle.drawCircle(1024 / 2, 300,0, 150);
flightAngle.setFillMode(OF_OUTLINE);    //OF_FILLED is the other option
flightAngle.setLineWidth(3);
flightAngle.drawCircle(1024 / 2, 300,0, 150);
flightAngle.drawLine(1024/2-150,1024/2+150,300,300,0,0);

But every time I run it I get this error

Can anyone please explain what is going on? I feel like what I am trying to do should be really simple...

Posts: 4

Participants: 2

Read full topic

When using ofSoundPlayer, is it possible to save the loaded audio file into the build? + DFT references

$
0
0

@laziemo wrote:

Ive created an audio visualizer app for a specific piece of music and want to share the app but the load function with ofSoundPlayer requires the user to have the source sound file and also have it placed in a specific folder heirarchy.

Is there anyway to save the audio file as part of the app?

An alternative I found was using the ofxPortSF add-on which is great because it allows the user to load their own files as well - but then I face the issue of not being able to perform a DFT on the audio since I'm using the ofGetSoundSpectrum() which only works for sounds loaded using ofSoundPlayer :frowning:

Any suggestions ?

The only thing I can think of now is to write my own function to perform a DFT - which I do want to be able to eventually do but thats a long term solution. Either way I guess this is the right time and place to ask for good resources on writing DFT Functions.

Cheers!

Posts: 1

Participants: 1

Read full topic

ofxFaceTracker - can't get it to run

$
0
0

@ch3 wrote:

I would like to try out the ofxFaceTracker addon, but all the examples I am trying to compile give me the error below.
I have ofxCv already installed and running in other projects, but the error mentions an unresolved symbol from it. Do I have an older version of anything that causes that?
Any ideas?
thanks

> Severity	Code	Description	Project	File	Line	Suppression State
> Error	LNK2019	unresolved external symbol "float __cdecl ofxCv::trackingDistance(class cv::Rect_<int> const &,class cv::Rect_<int> const &)" (?trackingDistance@ofxCv@@YAMABV?$Rect_@H@cv@@0@Z) referenced in function "public: virtual class std::vector<unsigned int,class std::allocator<unsigned int> > const & __thiscall ofxCv::Tracker<class cv::Rect_<int> >::track(class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > const &)" (?track@?$Tracker@V?$Rect_@H@cv@@@ofxCv@@UAEABV?$vector@IV?$allocator@I@std@@@std@@ABV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@4@@Z)	example-cutout	D:\myStuff\ch3\dev\Visual Studio 2015\of_v0.9.8_vs_release\addons\ofxFaceTracker\example-cutout\ContourFinder.obj	1

Posts: 4

Participants: 2

Read full topic

Application size

$
0
0

@massimiliano wrote:

Hello,

I compile for example quaternionLatLongExample

but size of executable is 15.7 MB.

It's normal for an application that take a sphere and rotate it ?

Posts: 2

Participants: 2

Read full topic


Fastest method for direct pixel modification

$
0
0

@ethan wrote:

Hey All,

I have an animation algorithm which works by taking all the pixel values on the screen and slightly modifying their colors. Unsurprisingly, for big screens this really chugs, since it performs multiple operations for every individual pixel. Currently I am implementing this by reading the screen into an ofImage, looking at each pixel, and writing new pixels based on those values. I then draw this new ofImage. For fullspeed playback, I have an array of ofImages of every frame preprocessed and draw them for each frame.

I'm wondering whether this is the fastest process or if there are better methods. Does openGL have anything which makes it easier to read pixels without the intermediary object? When doing operations which don't require any other drawing methods, I'm simply using the previous ofImage, which does help a little.

I saw this exact question hadn't been asked for a few years and just wanted to check whether I'm thinking about the problem correctly since I'm planning to do a lot with this effect.

Thanks in advance for any help.

Posts: 1

Participants: 1

Read full topic

./install_dependencies.sh does not install

$
0
0

@BigCantaloupe wrote:

Hi,

New user here. I tried to install the dependancies according to the msys2 instructions, however msys2 cannot find the packages:

Total Download Size: 0.98 MiB
Total Installed Size: 1654.49 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
error: failed retrieving file 'mingw-w64-i686-gcc-libgfortran-6.2.0-2-any.pkg.tar.xz' from repo.msys2.org : Connection timed out after 10000 milliseconds
error: failed retrieving file 'mingw-w64-i686-gcc-libgfortran-6.2.0-2-any.pkg.tar.xz' from downloads.sourceforge.net : Operation timed out after 10889 milliseconds with 0 out of 0 bytes received
error: failed retrieving file 'mingw-w64-i686-gcc-libgfortran-6.2.0-2-any.pkg.tar.xz' from www2.futureware.at : The requested URL returned error: 404
warning: failed to retrieve some files
error: failed retrieving file 'mingw-w64-i686-isl-0.17.1-1-any.pkg.tar.xz' from repo.msys2.org : Connection timed out after 10001 milliseconds
mingw-w64-i686-isl-... 570.9 KiB 500K/s 00:01 [#####################] 100%
error: failed retrieving file 'mingw-w64-i686-zziplib-0.13.62-5-any.pkg.tar.xz' from repo.msys2.org : Connection timed out after 10000 milliseconds
mingw-w64-i686-zzip... 157.1 KiB 124K/s 00:01 [#####################] 100%
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.
error installing packages, there could be an error with your internet connection

Does anyone have a workaround?

Thank you.

Posts: 2

Participants: 1

Read full topic

Encountered error trying to make oF libraries

$
0
0

@BigCantaloupe wrote:

Hi again,

I am trying to compile oF libraries, according to the instructions described in the installation guide:

http://openframeworks.cc/setup/msys2/
Open an MINGW32 shell (run C:\msys64\mingw32_shell.bat) and compile oF libraries:
cd your_oF_directory/libs/openFrameworksCompiled/project
make

The error I encountered is:

$ make
HOST_OS=MINGW32_NT-6.3
makefileCommon/config.shared.mk:217: *** This package doesn't support your platform, probably you downloaded the wrong package?. Stop.

Does anyone know what the issue may be? I don't know what package I need.

I followed the steps before, including downloading and installing msys2 x64, unzipping the latest oFW, and installing the latest dependencies. They seemed to have worked.

Thank you.

Posts: 1

Participants: 1

Read full topic

How do I create a custom class in Visual Studio?

$
0
0

@jadie_p1 wrote:

I am writing a program to generate cells using Wolfram's rule. It is called Cellular Automata, But I call it ca for short in the program. I have made a function called void ofApp :: cells (float ca) and then I have written ca.push_back.display(); but it says 'Expression must have a class type' can someone please tell me what this means and give an example? Lastly I should mention that ca is in written like this in the header filevector <float> ca;

Thanks,

Jade

Posts: 9

Participants: 2

Read full topic

How to move circles repetitively

$
0
0

@jadie_p1 wrote:

Hi,

I am trying to create snowballs falling down the screen continuously. I gotten them to move down, but I need them to offset so that they all move down differently. I know this is a bit of a silly question, but I am only just starting to program in C++ could someone help please?

here is my h. file:

#pragma once

#include "ofMain.h"

class ofApp : public ofBaseApp{

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

		void ball(int i);

		ofImage maple;


		float time;
		float xPos, yPos, startingX, startingY, spacingX, spacingY;


};

Here is my cpp. file:

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
	maple.load("maple_leaf.png");
	time = 0;
	ofSetFrameRate(100);
	yPos = 1;
	ofSetBackgroundColor(54,81,94,100);
	startingY = 4;
	spacingY = ofGetHeight() / startingY;



}

//--------------------------------------------------------------
void ofApp::update(){
	time += 0.05;
	yPos += 2;
	if (ofGetHeight() < yPos) {
		yPos = 5;
	}
}

//--------------------------------------------------------------
void ofApp::draw(){
	for (int i = 0; i < 100; i++) {
	ball(i);

	}
}

void ofApp::ball(int i) {
	ofPushMatrix();

	float locY = spacingY * i + startingY;
	float offset = ofMap(ofDist(0, locY, ofGetWidth(), ofGetHeight() / 3), 0, ofGetWidth(), locY, 0); // the second to last value changes the offset, which changes the mapping of each row of circles
	float osc = ofMap(sin(time + offset), -1, 1, 0, 1); // oscillation controls movement of the cirles, controlled by sin which uses time to control speed and offset to control the timing of movement
	ofTranslate(0, osc);
	ofSetColor(255);
	ofCircle(ofRandom(4, ofGetWidth() - 4), yPos, ofRandom(2,8));
	ofSetColor(0);
	//ofSetColor(255);
	ofPopMatrix;
}

Posts: 1

Participants: 1

Read full topic

Viewing all 4929 articles
Browse latest View live