GPU epsilon-close to cut plane in point cloud using GPU

I am trying to solve the current problem using the capabilities of the GPU: "given the cloud of P points and the oriented plane described by the point, and the normal (Pp, Np) returns points in the cloud that are at a distance equal to or less than EPSILON from an airplane."

Speaking with a colleague, I came to the following decision:

1) prepare a buffer of vertex points with an attached coordinate of the texture, so that each point has a different vertex coordinate 2) set the projection status to orthogonal 3) rotate the grid so that the normal of the plane is aligned with the -z axis and offset so that x, y, z = 0 corresponds to Pp 4) set the clipping plane z so that z: [- EPSILON; + EPSILON] 5) visualize the texture 6) extract the texture from the graphics card 7) read the texture from the graphics card and see what points were visualized (in terms of their indices), which are points within the required distance range.

Now the following problems arise: q1) Do I need to open a window frame to perform such an operation? I work in MATLAB and call MEX-C ++. I know from experience that as soon as you open a new frame, the entire costume will fail! q2), what is the primitive to give GLPoint the coordinate of the texture? q3) I do not quite understand how texture rendering will be implemented? any link, tutorial would be awesome ... q4) How would you extract this texture from the map? again, any reference, tutorial would be awesome ...

I am in a busy schedule, so it would be nice if you could give me the names of those methods that I should learn about, but rather the GLSL specification document and the OpenGL API, as someone did. This tiny bit is too vague an answer to my question.

Thanks so much for any comments.

ps Also note that I would prefer not to use any resource such as CUDA, if possible, and thus get what uses as many OpenGL elements as possible, without requiring me to write a new shader.

Note. http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=245911#Post245911

+4
source share
4 answers

It is simple: Let n be the normal of the plane and x the point.

n_u = n/norm(n) //this is a normal vector of unit length d = scalarprod(n,x) //this is the distance of the plane to the origin for each point p_i d_i = abs(scalarprod(p_i,n) - d) //this is the distance of the point to the plane 

Obviously, “scalarprod” means “scalar product” and “abs” means “absolute value”. If you're wondering why just read the article on scalar products on Wikipedia.

+1
source

Good at first as a small caveat: I don't know anything about 3D programming.

Now my purely mathematical idea:

Given the plane as normal N (unit length) and the distance L of the plane to the center (point [0/0/0]). The distance of the point X to the plane is given by the scalar product of N and X minus L and the distance to the center. Therefore, you should only check

| n x - L | <= epsilon

. being a scalar product and | | absolute value

Of course you need to cross the plane with the normal first to get the distance L.

Perhaps this helps.

0
source

I have one question for Andrea Tagliasacci, why?

Only if you look at 1000 points and a possible 100 aircraft, it would be useful to use the described method. As shown in the point product of a point and a plane, as outlined by my corporal Tacti.

Also, due to the finite nature of the pixels, you often find that two or more points will be projected onto the same pixel in the texture.

If you still want to do this, I could run a C ++ supersaturation trial program, but how could this help with MATLAB, which I don't know since I'm unfamiliar with it.

0
source

It seems to me that you should implement something similar to the Corporal Touchy method as a vertex program, and not a for loop, right? Maybe use C programming API for GPU, for example CUDA ?

0
source

Source: https://habr.com/ru/post/1276772/


All Articles