Prev: Gucci sale-Gucci outlet store-Cheap Gucci Bags-Handbags,40% off,Free Shipping Tax Free!
Next: problem on C++ Shared Library
From: Ian Pereira on 11 Jul 2010 03:13 Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane? I believe Yamaguchi has an algorithm, but I am not sure if it can be implemented into Matlab efficiently. Tx.
From: Roger Stafford on 11 Jul 2010 04:04 "Ian Pereira" <pereirai(a)rogers.com> wrote in message <i1bqu5$ig2$1(a)fred.mathworks.com>... > Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane? > > I believe Yamaguchi has an algorithm, but I am not sure if it can be implemented into Matlab efficiently. > > Tx. - - - - - - - It would depend on what is meant by "above" and "below". On the (almost) spherical earth, what is above a great circle plane and what is below it? Which way is up? If you consider the z-axis as being the up and down axis, then what would you say about a plane that is orthogonal to the x-y plane? If a plane in an xyz cartesian coordinate system is characterized by the equation a*x+b*y+c*z+d = 0 then a point with coordinates x, y, and z, lies to one side of the plane in accordance with the sign of a*x+b*y+c*z+d. Positive, it is on one side; negative, it is on the opposite side; and zero, it lies right on the plane. However, which side is which depends on the particular coeffficients selected for a, b, c, and d. If one reverses all their signs, then the above criterion reverses even though the plane is the same. Roger Stafford
From: us on 11 Jul 2010 05:36 "Ian Pereira" <pereirai(a)rogers.com> wrote in message <i1bqu5$ig2$1(a)fred.mathworks.com>... > Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane? > > I believe Yamaguchi has an algorithm, but I am not sure if it can be implemented into Matlab efficiently. > > Tx. this NG deals with ML language problems... us
From: Jan Simon on 11 Jul 2010 10:51 Dear Ian, > Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane? If you ask for "above or below", you obviously have defined a direction. This is usually the normal vector of the plane. To define the plane completely, you need also one point which is any element of the plane. The rest is easy: Measure the angle between 1. the vector from the point in your plane to the tested point and 2. the normal vector. How angles between vectors are measured efficiently has been discussed last week. Did you ask your teacher for help also? Jan
From: Ian Pereira on 12 Jul 2010 13:50
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i1cloo$s4h$1(a)fred.mathworks.com>... > Dear Ian, > > > Does anyone know an efficient algorithm to check if a 3D point lies above or below a plane? > > If you ask for "above or below", you obviously have defined a direction. This is usually the normal vector of the plane. To define the plane completely, you need also one point which is any element of the plane. > > The rest is easy: Measure the angle between 1. the vector from the point in your plane to the tested point and 2. the normal vector. How angles between vectors are measured efficiently has been discussed last week. > > Did you ask your teacher for help also? > Jan Worked perfectly. The main issue was the sign convention that matlab used, but I worked it out with a few test cases. This was part of an algorithm to select all mesh vertices above a user-selected plane in a 3D reconstruction and manipulation app. Currently I'm scrolling through all mesh vertices and using the angles to see if they are above or below the plane. As some meshes are rather large (>50k faces), this can be a bit time-consuming, but at least it works now. |