Creating a Polygon on a Plane
I have a Plane defined as
Ax + By + Cz + D = 0
and i want to create a polygon that is coplanar with this.
I have a feeling this is a really simple question, but my mind is blank on how to do it.
Thanks in advance for any help.
The vector (A,B,C) is the normal of your plane. If you normalize it, then whenever you take the dot product between some point and this normal, you should get -D. Take a look at the plane equation, expand the dot product, and you can see that this is simply a reiteration of the equation.
You really can''t just "choose" a point on the plane. You have to pick one of the two axis values, and then determine the third. So if you chose an X and Y, you can calculate a Z, if you chose a Y and Z, you can calculate an X, etc.
Just chose a bunch of X''s and Y''s, and then calculate the Z for each, and you have a coplanar polygon.
You really can''t just "choose" a point on the plane. You have to pick one of the two axis values, and then determine the third. So if you chose an X and Y, you can calculate a Z, if you chose a Y and Z, you can calculate an X, etc.
Just chose a bunch of X''s and Y''s, and then calculate the Z for each, and you have a coplanar polygon.
You could also just pick three random points and project them onto said plane.
delete this;
a method to get a poly which exists and has got finit area ( points are not in a straight line or something like that):
find the intersection of the ray through the origin in the direction of the nomal (A,B,C) with the plane. that''s the first point. then find a nonzero component of the normal, invert its sign, exchange it with another component of the normal and set the third component to 0. add the resulting vector which I''ll call v1 to the first point to get the second point.
then compute v2 with the cross product of v1 and the normal
v2 = v1 x (A,B,C)
add v2 to the first or the second point to get the third point.
find the intersection of the ray through the origin in the direction of the nomal (A,B,C) with the plane. that''s the first point. then find a nonzero component of the normal, invert its sign, exchange it with another component of the normal and set the third component to 0. add the resulting vector which I''ll call v1 to the first point to get the second point.
then compute v2 with the cross product of v1 and the normal
v2 = v1 x (A,B,C)
add v2 to the first or the second point to get the third point.
Visit our homepage: www.rarebyte.de.stGA
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement