Quantcast
Channel: bugs, errors - openFrameworks
Viewing all 636 articles
Browse latest View live

OF 0.10 iOS Issues

$
0
0

@Miles wrote:

A couple of current bugs/differences with the iOS distribution that I’ve noticed using it so far:

  • Project Generator is the OSX version, not iOS
  • Multitouch doesn’t work, so touch.id is always 0, and touch.numTouches is always 1
  • Orientation seems to work differently, it doesn’t seem to rotate, it always stays portrait.

The multitouch and orientation pieces I have checked by moving an app’s source code and testing on of 0.9 and 0.10

Posts: 1

Participants: 1

Read full topic


ofxSVG content not sized correctly

$
0
0

@nebulus_design wrote:

Hi All

I’m using the ofxSVG add-on to load in svg files I’m making using Inkscape, and have found out that they get loaded in incorrectly scaled.

It looks like an issue with the svgtiny library, not properly scaling the contents, doing a bit of hacking I’m able to scan the start of the svg file manually finding the svg’s width and height, and then scaling the values that ofxSVG::getWidth() and ofxSVG::getHeight() report back.

Anyone else seeing the same issue?

I think the best place to fix this is in the svgtiny libraries code, but it looks like the library is supplied as a binary, where is this coming form?

I’m using the SVG files to control a laser cutter, so it’s pretty important they are sized correctly!
While my hack works, I’d like to try and sort this out the right way!

Posts: 1

Participants: 1

Read full topic

ofxTCPClient: setup a connection that crashed

$
0
0

@CCx266 wrote:

Hello all,
I am using ofxTCPClient a lot. My use of it resemble to the examples, there not much else to do anyway to setup a connection. I use Raspberry Pi, and OF 0.10.

I realized that the first call to
ofxTCPClient::setup(string ip, int _port, bool blocking)
is OK in terms of CPU time taken,
However:
If you have a working connection,
then you shut it up on the server side (i’m using Pure-Data, I close the window, brutally),
and reopen it (setup() is called again)

the system freeze and there is not even an ofLogError.
Should we close() the connection if disconnected from server, before setup() again ?
(EDIT: it is not enough to close() it)
Thanks.

There is the setup() function of ofxTCPClient.cpp:

Posts: 1

Participants: 1

Read full topic

Cannot compile a local addon with libraries

$
0
0

@thomasgeissl wrote:

Heyho people,
is someone working with local addons instead of global ones?

I am not able to compile an addons with an dylib dependency.
Not sure this is a bug from my side or an of bug. can someone confirm that local addons which use libraries work?
having the same addon globally installed work without problems. other addons not including any library seem to work.

duplicate symbol __ZN6ofxGit10repository12isRepositoryEv in:
    obj/osx/Release/local_addons/ofxGit2/src/ofxGit2.o
    /Users/thomasgeissl/projects/openFrameworks/apps/devApps/ofPackageManager/obj/osx/Release/addons/ofxGit2/src/ofxGit2.o
duplicate symbol __ZN6ofxGit10repository13getCommitHashEv in:
    obj/osx/Release/local_addons/ofxGit2/src/ofxGit2.o
    /Users/thomasgeissl/projects/openFrameworks/apps/devApps/ofPackageManager/obj/osx/Release/addons/ofxGit2/src/ofxGit2.o
duplicate symbol __ZN6ofxGit10repository8checkoutENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    obj/osx/Release/local_addons/ofxGit2/src/ofxGit2.o
    /Users/thomasgeissl/projects/openFrameworks/apps/devApps/ofPackageManager/obj/osx/Release/addons/ofxGit2/src/ofxGit2.o
duplicate symbol __ZN6ofxGit10repository5cloneENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    obj/osx/Release/local_addons/ofxGit2/src/ofxGit2.o
    /Users/thomasgeissl/projects/openFrameworks/apps/devApps/ofPackageManager/obj/osx/Release/addons/ofxGit2/src/ofxGit2.o
duplicate symbol __ZN6ofxGit10repositoryC2ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    obj/osx/Release/local_addons/ofxGit2/src/ofxGit2.o
    /Users/thomasgeissl/projects/openFrameworks/apps/devApps/ofPackageManager/obj/osx/Release/addons/ofxGit2/src/ofxGit2.o
duplicate symbol __ZN6ofxGit10repositoryC1ENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    obj/osx/Release/local_addons/ofxGit2/src/ofxGit2.o
    /Users/thomasgeissl/projects/openFrameworks/apps/devApps/ofPackageManager/obj/osx/Release/addons/ofxGit2/src/ofxGit2.o
ld: 6 duplicate symbols for architecture x86_64

thanks a lot

Posts: 3

Participants: 2

Read full topic

Can not install on Kali Linux

$
0
0

@erixom wrote:

I installed the dependencies required for Debian which Kali is based on but whenever I try to compile OF I get the following error:
"error: cannot convert ‘ofPtr’ to ‘bool’ in assignment
supportVAOs = ofGetGLProgrammableRenderer();// || glewIsSupported(“GL_ARB_vertex_array_object”); <- this should work but has false positives on some cards like emulation in vm’s
^
makefileCommon/compile.core.mk:228: recipe for target ‘…/…/…/libs/openFrameworksCompiled/lib/linux64/obj/Debug/libs/openFrameworks/gl/ofVbo.o’ failed
make[1]: *** […/…/…/libs/openFrameworksCompiled/lib/linux64/obj/Debug/libs/openFrameworks/gl/ofVbo.o] Error 1
makefileCommon/compile.core.mk:207: recipe for target ‘Debug’ failed
make: *** [Debug] Error 2
there has been a problem compiling Debug OF library
please report this problem in the forums
"

Please advise, thanks!

Posts: 1

Participants: 1

Read full topic

getNextMessage() in ofxOsc depricated?

$
0
0

@no_u wrote:

Hello,

I’m working on a project that requires OSC and I’m using ofxOsc. Everything’s going okay, but xCode is complaining that the function getNextMessage() is deprecated. There’s no mention of this being the case in the documentation for this function though.

Is xCode just wrong on this? Thanks for any insight!

Posts: 3

Participants: 2

Read full topic

ofxNcurses example won't build

$
0
0

@bernardoaraujor wrote:

I’m trying to compile the ofxNcurses example, without success.

I have a feeling some parts of the project might be outdated, especially because the last commit to the ofxNcurses github repo was in 2014.

bernardo@paulo-K46CB:~/openFrameworks/addons/ofxNcurses/example$ ls
addons.make  config.make        Makefile  openFrameworks-Info.plist  src
bin          example.xcodeproj  obj       Project.xcconfig
bernardo@paulo-K46CB:~/openFrameworks/addons/ofxNcurses/example$ make
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Compiling OF library for Release
make[1]: Entering directory '/home/bernardo/openFrameworks/libs/openFrameworksCompiled/project'
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Done!
make[1]: Leaving directory '/home/bernardo/openFrameworks/libs/openFrameworksCompiled/project'


Compiling example for Release
make[1]: Entering directory '/home/bernardo/openFrameworks/addons/ofxNcurses/example'
HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
with PKG_CONFIG_LIBDIR=
Compiling /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp
g++ -c -O3 -march=native -mtune=native -DNDEBUG -Wall -Werror=return-type -std=c++14 -DGCC_HAS_REGEX -DOF_USING_GTK -DOF_USING_GTK -DOF_USING_MPG123  -D_REENTRANT -pthread -I/usr/include/gstreamer-1.0 -I/usr/lib/x86_64-linux-gnu/gstreamer-1.0/include -I/usr/include/AL -I/usr/include/alsa -I/usr/include/libdrm -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../../libs/fmodex/include -I../../../libs/glm/include -I../../../libs/glm/include/glm -I../../../libs/glm/include/glm/gtc -I../../../libs/glm/include/glm/simd -I../../../libs/glm/include/glm/detail -I../../../libs/glm/include/glm/gtx -I../../../libs/json/include -I../../../libs/kiss/include -I../../../libs/pugixml/include -I../../../libs/tess2/include -I../../../libs/utf8/include -I../../../libs/utf8/include/utf8 -I../../../libs/openFrameworks -I../../../libs/openFrameworks/math -I../../../libs/openFrameworks/events -I../../../libs/openFrameworks/app -I../../../libs/openFrameworks/3d -I../../../libs/openFrameworks/gl -I../../../libs/openFrameworks/communication -I../../../libs/openFrameworks/utils -I../../../libs/openFrameworks/video -I../../../libs/openFrameworks/sound -I../../../libs/openFrameworks/types -I../../../libs/openFrameworks/graphics -I/home/bernardo/openFrameworks/addons/ofxNcurses/example/src -I/home/bernardo/openFrameworks/addons/ofxNcurses/src -MMD -MP -MF obj/linux64/Release/src/main.d -MT obj/linux64/Release/src/main.o -o obj/linux64/Release/src/main.o -c /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp
In file included from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:3:0:
/home/bernardo/openFrameworks/addons/ofxNcurses/src/ofAppCurses.h:44:11: error: invalid covariant return type for ‘virtual ofPoint ofAppCurses::getWindowPosition()’
  ofPoint  getWindowPosition();
           ^
In file included from ../../../libs/openFrameworks/ofMain.h:80:0,
                 from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:1:
../../../libs/openFrameworks/app/ofAppBaseWindow.h:47:20: error:   overriding ‘virtual glm::vec2 ofAppBaseWindow::getWindowPosition()’
  virtual glm::vec2 getWindowPosition() {return glm::vec2(); }
                    ^
In file included from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:3:0:
/home/bernardo/openFrameworks/addons/ofxNcurses/src/ofAppCurses.h:45:11: error: invalid covariant return type for ‘virtual ofPoint ofAppCurses::getWindowSize()’
  ofPoint  getWindowSize();
           ^
In file included from ../../../libs/openFrameworks/ofMain.h:80:0,
                 from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:1:
../../../libs/openFrameworks/app/ofAppBaseWindow.h:48:20: error:   overriding ‘virtual glm::vec2 ofAppBaseWindow::getWindowSize()’
  virtual glm::vec2 getWindowSize(){return glm::vec2(); }
                    ^
In file included from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:3:0:
/home/bernardo/openFrameworks/addons/ofxNcurses/src/ofAppCurses.h:46:11: error: invalid covariant return type for ‘virtual ofPoint ofAppCurses::getScreenSize()’
  ofPoint  getScreenSize();
           ^
In file included from ../../../libs/openFrameworks/ofMain.h:80:0,
                 from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:1:
../../../libs/openFrameworks/app/ofAppBaseWindow.h:49:20: error:   overriding ‘virtual glm::vec2 ofAppBaseWindow::getScreenSize()’
  virtual glm::vec2 getScreenSize(){return glm::vec2(); }
                    ^
/home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp: In function ‘int main()’:
/home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:7:33: error: invalid new-expression of abstract class type ‘ofAppCurses’
  ofAppBaseWindow * window = new ofAppCurses;
                                 ^
In file included from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:3:0:
/home/bernardo/openFrameworks/addons/ofxNcurses/src/ofAppCurses.h:35:7: note:   because the following virtual functions are pure within ‘ofAppCurses’:
 class ofAppCurses : public ofAppBaseWindow {
       ^
In file included from ../../../libs/openFrameworks/ofMain.h:80:0,
                 from /home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:1:
../../../libs/openFrameworks/app/ofAppBaseWindow.h:28:15: note: 	virtual void ofAppBaseWindow::setup(const ofWindowSettings&)
  virtual void setup(const ofWindowSettings & settings)=0;
               ^
../../../libs/openFrameworks/app/ofAppBaseWindow.h:29:15: note: 	virtual void ofAppBaseWindow::update()
  virtual void update()=0;
               ^
../../../libs/openFrameworks/app/ofAppBaseWindow.h:30:15: note: 	virtual void ofAppBaseWindow::draw()
  virtual void draw()=0;
               ^
../../../libs/openFrameworks/app/ofAppBaseWindow.h:38:25: note: 	virtual ofCoreEvents& ofAppBaseWindow::events()
  virtual ofCoreEvents & events() = 0;
                         ^
../../../libs/openFrameworks/app/ofAppBaseWindow.h:39:44: note: 	virtual std::shared_ptr<ofBaseRenderer>& ofAppBaseWindow::renderer()
  virtual std::shared_ptr<ofBaseRenderer> & renderer() = 0;
                                            ^
/home/bernardo/openFrameworks/addons/ofxNcurses/example/src/main.cpp:8:20: error: ‘ofSetWindow’ was not declared in this scope
  ofSetWindow(window);
                    ^
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:221: recipe for target 'obj/linux64/Release/src/main.o' failed
make[1]: *** [obj/linux64/Release/src/main.o] Error 1
make[1]: Leaving directory '/home/bernardo/openFrameworks/addons/ofxNcurses/example'
../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:124: recipe for target 'Release' failed
make: *** [Release] Error 2

Posts: 1

Participants: 1

Read full topic

Opencv_calib3d310.lib occurred error and solved

$
0
0

@sewonist wrote:

Hi all

I just want to make depth mask from StereoBM with ofxOpenCv and ofxCv. At the time, I had two errors.

First, I found sample like below.

cv::StereoBM sbm; //stereo block matching
sbm(imgMatL, imgMatR, stereoMat); // Calculate the diaparity and save into stereoMat

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E0322	object of abstract class type "cv::StereoBM" is not allowed:	depth	c:\of_v0.10.0_vs2017_release\apps\test\depth\src\ofApp.cpp	19	

I fixed it like below

cv::Ptr<cv::StereoBM> sbm = cv::StereoBM::create();
sbm->compute(imgMatL, imgMatR, stereoMat);

Second, there was link error with opencv_calib3d310d.lib

Error	LNK2019	unresolved external symbol ___std_reverse_trivially_swappable_4 referenced in function "void __cdecl std::_Reverse_unchecked1<unsigned int *>(unsigned int * const,unsigned int * const,struct std::integral_constant<unsigned int,4>)" (??$_Reverse_unchecked1@PAI@std@@YAXQAI0U?$integral_constant@I$03@0@@Z)	depth	C:\of_v0.10.0_vs2017_release\apps\test\depth\opencv_calib3d310d.lib(circlesgrid.obj)	1	

I checked Linker Input and it looks like alright. So, I download OpenCV build from OpenCv site and change lib to opencv_world310d.lib. Althought it need opencv_world310d.dll, works fine.

I’m not sure what is problem. Anyway I just report it.

Posts: 1

Participants: 1

Read full topic


High Resolution Capable not working correctly [Mac users plz read]

$
0
0

@cuinjune wrote:

First of all, when I set High Resolution Capable to YES in openFrameworks-Info.plist file, the window shows up in half size than the size it was when High Resolution Capable was set to NO and this is the problem I can live with.

However, when I set the window width to be larger than my Mac Book Pro’s non-retina screen resolution(1440x900), suddenly the width of the window gets as big as the screen. (the window width becomes 2 times bigger when I change width to 1441 from 1440)

I assume there’s a code that compares the window dimensions with the screen dimensions so the window won’t get bigger than the screen size. But I think one made a mistake by using the non-retina resolution instead of retina.

The problem only happens with OF 0.10.0 and it works fine with OF 0.9.8.
Can any Mac users confirm this issue? How can we fix this?

Posts: 2

Participants: 1

Read full topic

ofPixelFormat pixelFormat

$
0
0

@dotchang wrote:

Some classes have a member variable which is ofPixelFormat pixelFormat.
And some of these classes also have same-named arguments of member functions.

such as class ofPixels_,
void allocate(size_t w, size_t h, ofPixelFormat pixelFormat);
ofPixelFormat pixelFormat;

I think it makes troubles seriously.
Actually, ofPixels::setColor is not worked on my Mac(XCode) environment, but same code worked on Windows10 MSVC environment.

Could you please consider improvement?

Posts: 1

Participants: 1

Read full topic

Of_v0.10.0 ofxGui - ofParameter not working?

$
0
0

@christopher_miles wrote:

Looks like examples/gui/guiExample works but examples/gui/parameterGroupExample doesn’t.

[warning] ofxBaseGroup; no control for parameter of type 11ofParameterI7ofVec2fE

Issue is when trying to make an ofParameterGroup and adding ofParameter (using ofVec2f or ofVec3f). ofxVec2Slider/ofVec3Slider works but when you’re grouping things with ofParameterGroup it doesn’t. Is this happening to anyone else?

(using OSX build v0.10.0) @arturo

Posts: 7

Participants: 2

Read full topic

Weird font error with of 0.10

$
0
0

@phaseIV wrote:

Here’s the problem:

The top line is rendered with font.drawStringAsShapes(), the bottom line with font.drawString(). The same thing happens with different fonts.
DrawStringAsShapes() used to work with 0.98 and i’m pretty clueless what would cause the glyphs to gather at the top of the line. Does anyone have clues or hints what’s going wrong here?

Posts: 2

Participants: 1

Read full topic

Sudden mysterious build errors in standard files included via ofMain.h?

$
0
0

@Drazinut wrote:

I imagine this is something I caused by adding files and code to my project, but I haven’t been able to deduce what might be wrong, and I wonder if anyone here recognizes this symptom. Suddenly when I try to build my project, it reports many pages of basic errors in standard library files, citing them being included from files of mine that I have not edited since the last time the project built and ran just fine.

I did add one .h file that had only C-style commented-out text in it, which had ended with an unclosed comment “/*”, which of course broke the build, but I fixed that and tried building with no text in that file, but after that, the whole project has just been unable to build despite apparently being ok. I backed out recent changes even though they looked ok, but I still keep getting these weird errors in standard files.

The errors start out like this (and none of them really reference the code I wrote):

In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:9:0,
                 from /home/dronz/OF/libs/openFrameworks/utils/ofConstants.h:2,
                 from /home/dronz/OF/libs/openFrameworks/ofMain.h:6,
                 from /home/dronz/OF/apps/myApps/Champion/src/UIMode.h:19,
                 from /home/dronz/OF/apps/myApps/Champion/src/modeMainMenu.h:3,
                 from /home/dronz/OF/apps/myApps/Champion/src/modeMainMenu.cpp:1:
/usr/include/stdint.h:286:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)

I have been building on Linux and things have been building smoothly otherwise. This is the first time I saw anything like this. I expect I must have an extra bracket character somewhere or something, but I wonder if anyone has seen this before and has a clue?

Posts: 2

Participants: 1

Read full topic

Projectgenerator (CL or GUI) hangs for only one of my projects

$
0
0

@dylanmach wrote:

despite attempting to build with or without addons, one of my projects seems to hang after listing all files in command line (project gen works correctly when updating other projects)

I am at a loss (have reinstalled OF, have removed one addon at a time) and was curious if anyone ever ran into this and what I should try next.

Posts: 2

Participants: 1

Read full topic

Bug: OF website defunct links to android sdk


A fix for OSX translocation

$
0
0

@genekogan wrote:

This question is in regards to the downloadable release of ml4a-ofx on OSX.

After download, none of the apps have access to the files in the data folder until each app is manually moved to another folder and then moved back. This is due to OSX now translocating the app as a security feature until they are moved.

One workaround is to bundle the data into the internal resources folder inside .app but this is problematic because all the apps have to share some large data files, which I’d prefer not to duplicate.

Is there any other workaround which makes this moving trick unnecessary so it behaves as expected?

Posts: 2

Participants: 2

Read full topic

No console window anymore?

$
0
0

@lilive wrote:

Hi,

I’m switching to OF 0.10.0, QtCreator 4.6.1 (Windows 7)

There are great improvements !

But I have a problem with the console window: when I start an .exe from the exporer, I have no console window. This can be really nice, but now I want to read the app output (cout or ofLog). If I start the same .exe from the command line, I can’t read them neither. I only see them in the QtCreator output panel.

I’ve found nothing about that in the documentation nor in the changelog. I wonder if there is something I can do to retrieve the console window when I need it.

Thanks, and bravo to all the contributors of this release :slight_smile:

Posts: 6

Participants: 2

Read full topic

ofCamera::worldToScreen returning wrong coordinates?

$
0
0

@Bentley wrote:

Hi oF people.

I’m currently trying to do some hit detection of billboarded panels sitting above a 3D environment. Basically they are labels that sit atop buildings. I’m using a billboard shader to draw the labels which is very effective.

I want to be able to click on the labels in order to access more information about the 3D point that it is attached to.

To do this I want to get the 3D position of the point in world space, I then want to convert it to screen space by using cam.worldToScreen§;

ofCamera cam;
// World coordinate of Point
ofVec3f worldP = ofVec3f(x, y,z);
ofVec3f screenCoordinateOfP;
screenCoordinateOfP = cam.worldToScreen(worldP);
if(mouseIsNearToPoint(screenCoordinateOfP)) {
// Do stuff
}

I would have thought this would work but instead when I call worldToScreen(worldP); I end up getting weird numbers, mostly numbers that are way off-screen. For a given world point which should return sensible values like: (728, 450) (calculated using a screen ruler)

I’m getting values like: (2365.24, -645.439) which on a 1920x1080 screen would mean that the point is off-screen.

Any idea why these numbers seem so wrong? Once have the screen coordinate of the point I can easily work out if my mouse is near it!

Thanks,

James Bentley

Posts: 2

Participants: 1

Read full topic

Problem with locale and sscanf (ofxImGui related)

$
0
0

@lilive wrote:

Hi,

I’m parsing a file containing this text:

Pos=60,10

The parsing code is:

float x, y;
sscanf( line, "Pos=%f,%f", &x, &y)

It takes the comma as a numeric dot and it give

x = 60.10
y = 0.0

instead of

x = 60.0
y = 10.0

I’ve found that I can put:

#include <locale.h>
setlocale(LC_NUMERIC, "C")

in my ofApp.cpp to fix it.

But I don’t know if this is a good idea, or if I must expect some problems later in other parts af my app.
I’m not familiar with the locale subject. I can tell that this is the output of the command locale in the MSYS2 MINGW 32 console:

$ locale
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_ALL=

I’m using OF0.10.0 msys release, QtCreator and Windows 7.

Can you give me some advices ?
I would prefer not to change the parsing code, because it is part of ImGui, in the SettingsHandlerWindow_ReadLine function.
I’m making an app with ofxImGui (by @jvcleave) , and the problem is that ofxImGui fail to read the settings saved by the previous run of the app because of this problem.

Thanks :slight_smile:

Posts: 4

Participants: 2

Read full topic

ofxPostProcessing & OF 0.10.0

$
0
0

@bernard_Del wrote:

hello i have this error when compiling ofxPostProcessing …
an idea?

of_v0.10.0_linux64gcc6_release/addons/ofxPostProcessing/src/RenderPass.h:53:17: error: « shared_ptr » ne nomme pas un type; vouliez-vous utiliser « char16_t » ?
         typedef shared_ptr<RenderPass> Ptr;

Posts: 1

Participants: 1

Read full topic

Viewing all 636 articles
Browse latest View live