How do I draw normal of point cloud with arrow?

Feel free to ask any question here
Post Reply
JamesRayen
Posts: 19
Joined: Tue Aug 23, 2016 1:33 am

How do I draw normal of point cloud with arrow?

Post 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();
.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

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

Post 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...
Daniel, CloudCompare admin
Post Reply