how to draw a 3d circle around a known point on a line segment .
http://i.imgur.com/SkKwT.png
The image above illustrates my problem.I have a line AB and a point C on it, A,B,C are known values, i need to draw a circle with center on point C.The circle containing plane is perpendicular to the given line.
i know the equation of circle in 3d would be
P = C + R cos(A) U + R sin(A) V
but i don't know how to get U and V here as no point on the outline of circle is known..
thank you.
[Edited by - ohsin on February 11, 2010 7:38:13 AM]
If you know the distance of the plane to the origin you can calculate 2 points on the plane and generate a normal vector on the plane, multiplying this normal with your circle radius and adding it to center of your circle should give you a point on the circle.
This thread might prove useful. You need to find a length-one vector perpendicular to (B-A). Call it U. Then you can easily find V as the normalized cross product of U and (B-A).
i googled a bit more and found this link
http://newsgroups.derkeiler.com/Archive/Comp/comp.graphics.algorithms/2005-10/msg00267.html
Now i am drawing an ellipse instead of a circle using code from the link
..close yet far...
http://newsgroups.derkeiler.com/Archive/Comp/comp.graphics.algorithms/2005-10/msg00267.html
Now i am drawing an ellipse instead of a circle using code from the link
..close yet far...
Assuming you have the distance to the plane all you need is the plane equation: Ax + By + Cz + D = 0 with A, B and C being your plane's normal, D being the distance to the plane and x,y and z being any point on the plane. Once you have a point on the plane use the center of your circle and subtract the newly found point from that and normalize it, this gives you your U or V. Then use a cross product on either U or V with the normal of the plane and the result will be your U or V.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement