Skip to main content
GameDev.net gamedev.net
🔒 Locked

equation of a plane + point on plane and half width

Started by RavNaz Feb 28, 2011 at 11:04 PM 8 replies 2.2k views
Original Post
RavNaz
RavNaz
Am having a mental block with some maths I'm hoping someone can help me out with.

I have an equation of a plane in the form

Ax + By + Cz + D = 0

I know A,B,C and D. I have the centre point of the plane and the distance from the centre to the edge.

Is it possible to figure out from this two vectors at right angles to each other going towards the edge? e.g. from centre point to top edge and centre point to right edge?
alvaro
alvaro
I don't understand your question: A plane doesn't have a center point or an edge.
RavNaz
RavNaz
:-)

of course it doesn't.

I have a point on the plane.

Basically, I'm after getting the points of a circle from this equation.

so imagine a circle of known radius and centre is drawn onto that plane, so to speak.
RavNaz
RavNaz
its the radical plane formed by the circle made when two spheres intersect.
luca-deltodesco
luca-deltodesco
[A,B,C] is the normal of the plane,, let's assume it's normal for the sake of simplicity.

you can create two orthogonal tangents by projecting the normal onto it's maximal coordinate plane (for numerical stability) and normalising and rotating it 90 degrees in the plane, the cross product of this and the normal will then give you a second, orthogonal tangent

aka:


normal = (A,B,C)/sqrt(A^2+B^2+C^2)
m = min{|A| ,|B| ,|C|}
(m==|A|) -> tangent = (0,-C,<img src='http://public.gamedev.net/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />/sqrt(C^2+B^2)
(m==|B|) -> tangent = (-C,0,A)/sqrt(C^2+A^2)
(m==|C|) -> tangent = (-B,A,0)/sqrt(B^2+A^2)

bitangent = cross(normal,tangent).


then each point on the circle of radius R in the plane centred at P would be:

P + R*(cos(theta)*tangent + sin(theta)*bitangent)
RavNaz
RavNaz

[A,B,C] is the normal of the plane,, let's assume it's normal for the sake of simplicity.

you can create two orthogonal tangents by projecting the normal onto it's maximal coordinate plane (for numerical stability) and normalising and rotating it 90 degrees in the plane, the cross product of this and the normal will then give you the second normal.

aka:


normal = (A,B,C)/sqrt(A^2+B^2+C^2)
m = min{|A| ,|B| ,|C|}
(m==|A|) -> tangent = (0,-C,<img src='http://public.gamedev.net/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />/sqrt(C^2+B^2)
(m==|B|) -> tangent = (-C,0,A)/sqrt(C^2+A^2)
(m==|C|) -> tangent = (-B,A,0)/sqrt(B^2+A^2)

bitangent = cross(normal,tangent).


then each point on the circle of radius R in the plane centred at P would be:

P + R*(cos(theta)*tangent + sin(theta)*bitangent)



luca-deltodesco, thank you very much, that was the magic bit I couldn't quite recall and couldn't find reference to anywhere!!

(I should have been more clear in the original question).

thanks again.
RavNaz
RavNaz
out of interest, can anyone point me at a math tut or something where this is discussed?
Burnt_Fyr
Burnt_Fyr

out of interest, can anyone point me at a math tut or something where this is discussed?


Which part? The projection to 2D, the creation of a perpendicular vector, or the cross product?

Regardless Wikipedia has the answer...
RavNaz
RavNaz

[quote name='RavNaz' timestamp='1298937964' post='4780341']
out of interest, can anyone point me at a math tut or something where this is discussed?


Which part? The projection to 2D, the creation of a perpendicular vector, or the cross product?

Regardless Wikipedia has the answer...
[/quote]

the projection maths that luca uses to create the tangent
Burnt_Fyr
Burnt_Fyr


Vector n <3,4,5>

// Make unit length
normal = (A,B,C)/sqrt(A^2+B^2+C^2)

// for n<3,4,5> A is the minimum component.
m = min{|A| ,|B| ,|C|}

// the cross product of 2 vectors returns a vector perpendicular to the plane they exist on
// Since m = A, we use the X axis as the other vector. If m = B use <0,1,0> and if m=c use <0,0,1>

cross(n,<1,0,0>) = <0,-5,4> = <0,-C,B>

// Make unit length...since it is essentially a 2D vector, sqrt(b^2 + c^2) = magnitude

(m==|A|) -> tangent = (0,-C,<img src='http://public.gamedev.net/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />/sqrt(C^2+B^2)
(m==|B|) -> tangent = (-C,0,A)/sqrt(C^2+A^2)
(m==|C|) -> tangent = (-B,A,0)/sqrt(B^2+A^2)


bitangent = cross(normal,tangent).


Hope this helps, cheers!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.