smallfly / ofxOpenVR

Implementation of Valve Software's OpenVR API.
MIT License
73 stars 38 forks source link

conversion from ofMatrix4x4 to glm::mat4x4 #5

Closed SeanJD closed 7 years ago

SeanJD commented 7 years ago

I'm probably just missing something so this probably isn't a valid 'issue' but I can't seem to figure it...

In your example there are several places where ofMatrix4x4 and glm::mat4x4 combine - for example _shader.setUniformMatrix4f("matrix", hdmPoseMat, 1); The VS2015 compiler is throwing errors that it cannot convert from 'glm::mat4x4' to 'const ofMatrix4x4 &' i.e. the variable hdmPoseMat is of type glm::mat4x4 but the argument is of type ofMatrix4x4&

Any idea how to work around this? I have tried casting the types but the compiler doesn't allow it convert from one type to the other.

smallfly commented 7 years ago

What branch are you using? And what version of OF are you using?

The master and develop branches must be used with OF's master branch, which uses glm as mathematics library.

SeanJD commented 7 years ago

I was using oF 0.9.3 but I've just tried with 0.9.7 and the master branch, both with the master branch of ofxOpenVR and there are many compile error related to lack of glm/glm.hpp : C1083 cannot open include file: glm/glm.hpp No such file or directory... Obviously I can include and link glm lib from a download but I'm assuming it should be built into oF master branch from your comment above? Is that correct?

Thanks loads by the way... I have it up and running (albeit with issues having to manually juggle the glm::mat4x4 to ofMatrix4x4 ) and really appreiate the time you have put into making an openVR addon for the community

smallfly commented 7 years ago

How did you create your VS project? Have you used the latest version of the Project Generator?

My pleasure!

SeanJD commented 7 years ago

I was using the openFrameworks plugin. I've just created a new one with the Project Generator in v0.9.7 and it's still throwing the C1083 cannot open include file: glm/glm.hpp And as far as I can see there isn't a Project Generator with the master branch.

SeanJD commented 7 years ago

I've just created a new project with the Project Generator included in the 0.9.7 build but pointed it at the master version of oF, included the ofxOpenVR addon and set my includes and libs to the openVR paths. Still when I try to compile (afaik using the oF master branch pulled today) it's still throwing the same C1083 errors. I'm using VS2015 Community in case that helps?

Sorry to be a pain, thanks for your help!

smallfly commented 7 years ago

Sorry for the late reply.

I just created a new project using the Project Generator included in the 0.9.7. Then I have added the Property Sheet to the project (as mentioned in the readme) and it worked. I'm also using VS2015 Community.

Are you able to compile an empty project?

SeanJD commented 7 years ago

Hi, no worries. I just did exactly the same - created a new project using 0.9.7 project gen. Added the Property Sheet to the project. Hit F5 and it's coming up 72 errors of C1083 cannot open include file: glm/glm.hpp when trying to compile the source files which reference it. If glm is used by oF as maths library (maste or 097) does that mean I don't need to download and include any files to make that work?

Sorry to be a pin on this - probably something simple I'm doing wrong!

But I have followed the above process and it's not finding the glm.hpp file?

smallfly commented 7 years ago

Are you able to compile an empty OF project?

SeanJD commented 7 years ago

Yeah absolutely.

And I can use addons and include 3rd party libs etc.

It's only this glm.hpp my system doesn't like!

No worries if there's nothing obvious - I can investigate further at some point and post up anything I find here.

On 16 Nov 2016 5:16 p.m., "Hugues Bruyère" notifications@github.com wrote:

Are you able to compile an empty OF project?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smallfly/ofxOpenVR/issues/5#issuecomment-261009396, or mute the thread https://github.com/notifications/unsubscribe-auth/AGVKyE0zX-Ou1Vevc5oHkIFlpzmvpI6aks5q-zpVgaJpZM4KmJEp .

smallfly commented 7 years ago

Ok. I will close this for now. Thanks!

johanjohan commented 7 years ago

hey there,

similar issue here: OF 097 on Win10 using VS2015 community cloned ofxOpenVR fresh today

2>..\..\..\addons\ofxOpenVR\libs\OpenVR\src\vrcommon\sharedlibtools_public.cpp(16): error C2664: 'HMODULE LoadLibraryExW(LPCWSTR,HANDLE,DWORD)': cannot convert argument 1 from 'const char *' to 'LPCWSTR'

2>v:\00shared\dev8\of\of_v0.9.7_vs_release\addons\ofxopenvr\src\ofxOpenVR.h(61): error C2653: 'glm': is not a class or namespace name (compiling source file ..\..\..\addons\ofxOpenVR\src\ofxOpenVR.cpp)

and a lot more glm::mat4x4 errors.

update: do i need steamVR to be installed to get this working?

SeanJD commented 7 years ago

Hi Johan and Hugues.. Just so you know I didn't investigate further and fix this yet, I would like to at some point though as will be focusing on rapid prototyping in oF using this add-on. I would appreciate you posting the solution if you find out, and likewise I will if I get there first :)

On 4 Jan 2017 2:27 p.m., "Johanson Johan Johan" notifications@github.com wrote:

hey there,

similar issue here: OF 097 on Win10 using VS2015 community cloned ofxOpenVR fresh today

2>......\addons\ofxOpenVR\libs\OpenVR\src\vrcommon\sharedlibtools_public.cpp(16): error C2664: 'HMODULE LoadLibraryExW(LPCWSTR,HANDLE,DWORD)': cannot convert argument 1 from 'const char *' to 'LPCWSTR'

2>v:\00shared\dev8\of\of_v0.9.7_vs_release\addons\ofxopenvr\src\ofxOpenVR.h(61): error C2653: 'glm': is not a class or namespace name (compiling source file ......\addons\ofxOpenVR\src\ofxOpenVR.cpp)

and a lot more glm::mat4x4 errors.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smallfly/ofxOpenVR/issues/5#issuecomment-270382557, or mute the thread https://github.com/notifications/unsubscribe-auth/AGVKyHpJL0FHsGJeGSkJJqsMoX1J5aD9ks5rO6xRgaJpZM4KmJEp .

johanjohan commented 7 years ago

Hi SeanJD, I wish to use it for prototyping as well. This will need a dedicated setup instruction.

glm seems to be no more part of OF 097

smallfly commented 7 years ago

Hi,

For now I tried to keep the addon inline with the master branch of OF. And I'm not sure that glm was used in OF 0.9.7 yet.

Are you able to run a empty project where you make a simple call to glm? Have you tried with 0.9.8? You should maybe ping @jamesalliban who I think had some issues using the addon with 0.9.8.

Cheers.

jamesalliban commented 7 years ago

You can use this version with v0.9.8 - https://github.com/jamesalliban/ofxOpenVR. Have a look at the drawing example for usage.

Here are some install notes I put together for setting up a project from scratch:

johanjohan commented 7 years ago

Hi James, thanks a lot, I will try

johanjohan commented 7 years ago

@jamesalliban @smallfly excellent, it works. thx

SeanJD commented 7 years ago

Yes. I too have it working now with both 0.9.8 and the master branch. Excellent. Thanks!

On 5 Jan 2017 5:05 p.m., "Johanson Johan Johan" notifications@github.com wrote:

@jamesalliban https://github.com/jamesalliban @smallfly https://github.com/smallfly excellent, it works. thx

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/smallfly/ofxOpenVR/issues/5#issuecomment-270698309, or mute the thread https://github.com/notifications/unsubscribe-auth/AGVKyCz6KHE6HWISGQIPRIVvOonDOjVwks5rPSLogaJpZM4KmJEp .

jamesalliban commented 7 years ago

Great glad it's working for you.

ryokomy commented 7 years ago

Thanks to your great work and discussion, I also solved the glm problem! I summarized your discussion in my repository. https://github.com/RyoheiKomiyama/ofxOpenVR