-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Adds methods to display surfels/quad with normal vectors #802
Adds methods to display surfels/quad with normal vectors #802
Conversation
Nice! I look it ;)! |
By checking the Board3D I don't see the normal both with blender or Meshlab you use another viewer ? |
There are two versions of Display3DFactory::drawSurfelWithNormals, one for Cell, one for SCell. In fact, both types could be identical (CellularGridSpaceND implementation dependent). Hence I suggest to rename the methods
It would also disambiguate the boolean (double side) for normals. A Cell is double sided, a SCell no. |
// used to display surfels located at a same position. | ||
// double factorVolSurfel=1.0; | ||
|
||
DGtal::Z3i::RealPoint rp = display.embedK( k ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently embedK exists only for Cell and not for SCell.
The function is thus not instantiable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree.. there is a embedSK(k) for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oups it's embedKS(k)
. Fixed
wouldn't |
Go for drawOrientedSurfelWith... and drawUnorientedSurfelWith |
I still have some displaying issue when the estimated normal has a negative scalar product with the trivial normal. I must check a little bit more (are you "correcting" the normal at display time ?). |
Ok. I looked in DGtal::Display3D< Space ,KSpace >::addQuadWithNormal and normals are reversed if the scalar product is negative. I am not sure this is always desirable. Look at the example below. The estimated normal is close to the z-axis, so for some surfels (containing the z-axis) they appear black. |
In your example, do you use the "double-quad" feature ? |
@JacquesOlivierLachaud I've changed couple of things (function renaming, reorientation disabled for signed cell, ...) |
…OrientedSurfelWithNormal. Update examples and tests.
I have corrected a few things and modified Display3D. I think it is fine now. Merging. |
Adds methods to display surfels/quad with normal vectors
Ok for both Viewer3D and Board3D.
usage should be similar to
surfel being a Khalimsky cell (signed or not) and normalVector a unitary normal vector.
Illustration with a 100^3 digital sphere surface with "exact" normal vectors:
TODO:
BE CAREFUL : with QGLVIEWER, you need to press "D" to enable double-face rendering