lagadic / visp_cao_editor

Development of a CAD model editor for ViSP model-based tracker
GNU General Public License v3.0
19 stars 8 forks source link

Qt editor #20

Closed vikasTmz closed 7 years ago

vikasTmz commented 7 years ago

TODO:

s-trinh commented 7 years ago

@vikasTmz You can find here the equation and the code to transform an intrinsic matrix as represented in ViSP to a representation compatible with OpenGL / Qt3DRender::QCamera.

I did some quick tests. You are probably already aware of most of the issues but just for the record here some comments:

vikasTmz commented 7 years ago

QObjectPicker did not work in this version (tested with 3D face from lines or with a cylinder)

It works (Right click to select) but only when the camera is at a certain distance(close) from the object. Trying to see if the ray from the camera that should intersect the bounding volume is being affected by some setting.

https://forum.qt.io/topic/77570/qt3d-qobjectpicker-test-not-working-as-expected

vikasTmz commented 7 years ago

Should there be an option for the user to input Fov and aspect ratio? But in that case there are only two equations to solve for u0, v0, px and py. screenshot from 2017-08-11 21 24 36

s-trinh commented 7 years ago

Should there be an option for the user to input Fov and aspect ratio? But in that case there are only two equations to solve for u0, v0, px and py.

No, I prefer to keep only px, py, u0 and v0.

It works (Right click to select) but only when the camera is at a certain distance(close) from the object. Trying to see if the ray from the camera that should intersect the bounding volume is being affected by some setting.

Indeed, but we have to be very very close which make the interaction pretty difficult. Commenting the 3 lines that create the world axes solve the issue somehow on my computer. If there is no other solution, please remove the 3 axes drawing and use instead a small frame (similar to Blender at the bottom left):

image

Some comments:

vikasTmz commented 7 years ago

open XML editor button:

  • the user should be able to load an XML config file and modify it if he wants the user should be able to create a new XML config file from default parameters a button to save / load should be added in my opinion
  • save button should not silently overwrite the changes in my opinion, maybe add a save as button beside the save button?

These options are present in the toolbar (for the 3d viewer and xml editor).

s-trinh commented 7 years ago

Concerning the TODO list:

  • [ ] Fix cylinder and circle rotation.
  • [ ] Get lod settings (length & area) using camera intrinsic & extrinsic properties & world coord.
  • [ ] Save Qt3DRender::QCamera Settings into XML config file.
  • [ ] Display face normals.
  • [ ] Choose the 3D points for the init config file.
  • [ ] Fix bug: "run the application --> import CAO + save dialog make the application crash"
  • [x] Save user input LOD parameters.
  • [x] Clear scene option.
  • [x] Create a Qt3DRender::QCamera using the intrinsic parameters in the XML config file.
  • [x] QObjectpicker improvements.

There should be an option / button to "switch" the model points when the user see that the face normal is not correct (only for faces from points, face from lines and circles).

The feature Get lod settings (length & area) using camera intrinsic & extrinsic properties & world coord. should be done at the end. Can you explain what you will plan to do for this feature?

vikasTmz commented 7 years ago

Using this equation: screenshot from 2017-08-15 00 02 19 X<sub>w</sub> will be the world coordinates of a point. So for a line, get X<sub>w</sub> of each end and calculate x's. Then find the distance between them for minLineLength.

s-trinh commented 7 years ago

I have merged this pull request as I have some modifications to do. Please open another pull request for the rest of the tasks: