Page 1 of 1

How do I draw normal of point cloud with arrow?

Posted: Sat Jul 27, 2019 12:45 am
by JamesRayen
Hi, I want to draw a unit normal vector for every point with an arrow in the end point of the normal vector, or to say, I want to draw lines and planes in CC, is there any examples show me how to do this? For example, in qHoughNormals.cpp, after normal estimation, I want to draw normal vectors instead of just set

Code: Select all

cloud->showNormals(true);cloud->prepareDisplayForRefresh_recursive();
.

Re: How do I draw normal of point cloud with arrow?

Posted: Sat Jul 27, 2019 8:29 am
by daniel
This would be pretty heavy for the GPU, but it would be ok as long as you don't have too much points.

You can draw segments for each normal vector (with the OpenGL "GL_LINES" command). You would have to find the right spot in ccPointCloud::drawMeOnly (https://github.com/CloudCompare/CloudCo ... .cpp#L2503).

To draw the arrow would be more complex (and even more time consuming). But as the normal 'segment' would already start from the point toward the positive side, not sure if an arrow is necessary...