Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building example with mingw fails #2

Closed
sonoro1234 opened this issue Mar 10, 2020 · 14 comments
Closed

building example with mingw fails #2

sonoro1234 opened this issue Mar 10, 2020 · 14 comments

Comments

@sonoro1234
Copy link

Hi,

While tying to build example with mingw-64 I am getting this error and similar:

[  6%] Building CXX object CMakeFiles/qjSet.dir/src/glApp.cpp.obj
In file included from C:/LuaGL/gitsources/imGuIZMO.quat/example/src/tools/vGizmo.h:16,
                from C:\LuaGL\gitsources\imGuIZMO.quat\example\src\glWindow.h:16,
                from C:\LuaGL\gitsources\imGuIZMO.quat\example\src\glApp.cpp:26:
C:/LuaGL/gitsources/imGuIZMO.quat/example/src/tools/vgMath.h:259:25: error: member 'vgm::Vec3 vgm::Mat3::<unnamed union>
::<unnamed struct>::v0' with constructor not allowed in anonymous aggregate
        struct { VEC3_T v0 , v1 , v2 ; };
                        ^~

Could find this: https://stackoverflow.com/questions/41031424/constructor-not-allowed-in-anonymous-aggregate-string-in-struct

Thanks

@BrutPitt
Copy link
Owner

BrutPitt commented Mar 13, 2020

Thanks for reporting.
I never built imGuIZMO.quat with mingw, I just now tried to compile it, and get that error.

About StackOverflow link: is just curious because I compile regularly with gcc (with v.5.2 for compatibility, and just now tested in 9.2.1) and it doesn't even give me a warning.
(and, of course, not even with CLang in macOS and MSVC in Windows)

Anyway I'll fix it soon... today or tomorrow.

Thanks again.

@sonoro1234
Copy link
Author

Thanks for taking a look!!

@BrutPitt
Copy link
Owner

BrutPitt commented Mar 13, 2020

I just found out that it happens only with "standard" data type, and not with "templates": indeed using -DVGM_USES_TEMPLATE the compiler build it correctly
And is affect also GCC compiler (as it was rightly supposed to be), but not MSVC and CLang.

(Now the StackOverflow page have more sense for me)

I tested also Intel compiler, as well as MSVC and CLang, and only with gcc/mingw, and only not using template classes, this problem appeared

BrutPitt added a commit that referenced this issue Mar 14, 2020
@BrutPitt
Copy link
Owner

The issue should be solved

Try it and let me know

@sonoro1234
Copy link
Author

I could build now but had to change CMakeLists.txt : uncomment https://github.com/BrutPitt/imGuIZMO.quat/blob/master/example/CMakeLists.txt#L151 and also dont link against dl in https://github.com/BrutPitt/imGuIZMO.quat/blob/master/example/CMakeLists.txt#L161

There are some opengl initialization issues:

C:\LuaGL\gitsources\BUILDS\imguizmoquat>qjSet
Shaders/qjVert.glsl...
Shaders/qjVert.glslNOT OPEN...
Shaders/qjFragES2.glsl...
Shaders/qjFragES2.glslNOT OPEN...
Vertex shader(s) failed to link, fragment shader(s) failed to link.
ERROR: error(#280) Not all shaders have valid object code
ERROR: error(#280) Not all shaders have valid object code


Uniform variable "resolution" not found
Uniform variable "quatPt" not found
Uniform variable "diffuseColor" not found
Uniform variable "phongMethod" not found
Uniform variable "specularExponent" not found
Uniform variable "specularComponent" not found
Uniform variable "normalComponent" not found
Uniform variable "isFullRender" not found
Uniform variable "useShadow" not found
Uniform variable "useAO" not found
Uniform variable "matOrientation" not found
Uniform variable "Light" not found
Uniform variable "epsilon" not found
GL Error #1282(1282)  in File C:\LuaGL\gitsources\imGuIZMO.quat\example\src\qJulia.h at line: 68
Vertex shader was successfully compiled to run on hardware.

Fragment shader was successfully compiled to run on hardware.

Vertex shader(s) linked, fragment shader(s) linked.

GL Error #1280(1280)  in File C:\LuaGL\gitsources\imGuIZMO.quat\example\src\qJulia.h at line: 68
GL Error #1280(1280)  in File C:\LuaGL\gitsources\imGuIZMO.quat\example\src\qJulia.h at line: 68
GL Error #1280(1280)  in File C:\LuaGL\gitsources\imGuIZMO.quat\example\src\qJulia.h at line: 68
GL Error #1280(1280)  in File C:\LuaGL\gitsources\imGuIZMO.quat\example\src\qJulia.h at line: 68

@BrutPitt
Copy link
Owner

BrutPitt commented Mar 14, 2020

Shaders/qjFragES2.glslNOT OPEN...
It cannot find the GLSL shaders files or the Shaders folder used in example.
Have you this folder in same directory of qjset?

About CMake (thanks again!):
I need to remove the dl LIB, in Windows linking, like I make for SDL

P.S.
I just commented #find_package(glfw3 REQUIRED) because in some Linux distribution (like Fedora), it search GLFW lib in a "wrong" folder /usr/local/lib/, instead it is installed in the main lib folder /usr/lib .
I can to enable it in Windows ... anyway it should compile also without statement, searching glfw3.lib in the LIB path.

@sonoro1234
Copy link
Author

It cannot find the GLSL shaders files or the Shaders folder used in example.
Have you this folder in same directory of qjset?

Yes, that was the problem.( Wonderful images!!!)

With Shift, Ctrl and Alt movements are restricted to X, Y, Z axes (absolute axes)
Is there a mode to restrict movements to the axes represented by the imGuizmo (red, gren and blue arrows)

@BrutPitt
Copy link
Owner

BrutPitt commented Mar 14, 2020

I guess you mean like [0-45] degree on X axis, for example?
(If I have not misunderstood the question)
Currently this is not possible, but should be ease test the return rotation and to limit it.

@sonoro1234
Copy link
Author

sonoro1234 commented Mar 14, 2020

No, I dont mean restrict the amount of degrees. I mean the same that happens witn Shift, Ctrl and Alt (which restrict movement to an specific axis)

But as there are 6 axis (3 absolute axis X,Y,Z and 3 guizmo axis red, green, blue) I would like to restrict movement to the guizmo axis instead of absolute axis. For example to do a rotation only around blue axis.

@BrutPitt
Copy link
Owner

This is interesting, but unfortunately not currently... but it could be useful, it could be a future improvement.

@sonoro1234
Copy link
Author

sonoro1234 commented Mar 14, 2020

This could is done in https://github.com/CedricGuillemet/ImGuizmo#imguizmo for moving objects

I have just wrapped ImGuIZMO.quat in C functions (as in cimgui) and works fantastic.
I am planning to add it to https://github.com/sonoro1234/LuaJIT-ImGui

I only fail to understand the vec3 requeriments: what are valid inputs? why vec3(1,0,0) is not valid (arrow disappears and trying to move gives nans) but vec3(1,0,5) is valid? (not unit length vector)

Also: GLAPP_USE_VIRTUALGIZMO is defined but I cant find how to use it in the example, (Where to click)

@BrutPitt
Copy link
Owner

BrutPitt commented Mar 14, 2020

I have just wrapped ImGuIZMO.quat in C functions (as in cimgui) and works fantastic.
I am planning to add it to https://github.com/sonoro1234/LuaJIT-ImGui

Thanks to have take in consideration ImGuIZMO.quat

I only fail to understand the vec3 requeriments: what are valid inputs? why vec3(1,0,0) is not valid (arrow disappears and trying to move gives nans) but vec3(1,0,5) is valid? (not unit length vector)

Maybe a bug due to the latest changes?
Let me to test/debug
It was a previous bug: I don't forced the control on third (x) component (not used), so with y=0 and z=0 the normalized vector was "nan" (divide by 0) ... and just added extra controls

but vec3(1,0,5) is valid? (not unit length vector)

Yes is valid.
I get vec3 length, normalize it, transform in quaternion, build rotation, re-transform in normalized vec3, and multiply for length.
(obviously if you use a unit length vector, the last pass is not influential)

Also: GLAPP_USE_VIRTUALGIZMO is defined but I cant find how to use it in the example, (Where to click)

Should works using mouse on background viewport (not in ImGui windows)... if really was built with it
(you can see how I use it in glWindow.cpp: left-button rotate, right-button dolly)

Instead, in glChAoS.P is configured:

  • left-button: rotate
  • right-button or wheel: dolly (move z / zoom)
  • ctrl+right-button: pan (move x/y)
  • rotations around axes: same controls used in imGuIZMO.quat

You can start live webgl from:
Aizawa attractor
Or from config page:
wglChAoS.P

(for this I don't created a specific widget to move the objects: is possible to do it using VirtualGIZMO in Viewport: pan(x,y), dolly(z), and VirtualGIZMO is an integral part of imGuIZMO.quat ... but i can to think to extend it also to widgets)

@sonoro1234
Copy link
Author

Thanks for all. I tested after new commit and everything works!!

@BrutPitt
Copy link
Owner

Thanks to you to have tested it and to have reported the issues

BrutPitt added a commit to BrutPitt/vgMath that referenced this issue Mar 15, 2020
BrutPitt added a commit to BrutPitt/virtualGizmo3D that referenced this issue Mar 15, 2020
BrutPitt added a commit that referenced this issue Mar 18, 2020
BrutPitt added a commit that referenced this issue Mar 18, 2020
BrutPitt added a commit that referenced this issue Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants