- Home /
Need a math geeks help. point at which a line hit a plane
So i know the equation of a plane.
Ax + By +Cz = D
Normal is the normal vector to the plane.
A = normal.x
B = normal.y
C = normal.z
p1 and p2 are 2 points on the line (which will intercept a plane at some point)
X = (p2.x - p1.x)* T + p1.x
Y = (p2.y - p1.y)* T + p1.y
Z = (p2.z - p1.z)* T + p1.z
I also know what D equals I solved for that by moving stuff around
The problem is a need a general solution for T.
It should be something like
A ((p2.x - p1.x) * T + p1.x)) + B ((p2.y - p1.y) * T + p1.y)) + C ((p2.z - p1.z) * T + p1.z)) = D
At which point I need to isolate T But I cant see how to isolate T even if I expand it out.
Is there something i'm missing?
any help at all would be much appreciated.
oh wow... I wasted alot of time. :P
im thinking this is what your talking about?
http://docs.unity3d.com/Documentation/ScriptReference/Plane.Raycast.html
yea that seems to set the raycasthit you get back as having the point at which the plane intersects.
I actually checked mathf first and thought i was SOL.
Oh well, I did that once earlier already, I honestly spent hours basically figuring out how to rotate on a normal. How to find the normal and stuff, but I sure as hell understand alot more about vector math and stuff so its nice to be able to wrap my head around it and not just $$anonymous$$dless function calls. The function calls don't help after all if you dont know what function you need cause you dont know what they do.
Convert to answer if you want to be checked.
yea whoops thought i'd done so. Apparently i only gave the thumbs up
Answer by Fattie · Nov 14, 2012 at 06:28 AM
FTR you know PhysX will do this for you instantaneously right,
Documentation/ScriptReference/Plane.html
also
http://www.jtaylor1142001.net/calcjat/Solutions/VPlanes/VPtIntLPlane.htm
http://en.wikipedia.org/wiki/Line-plane_intersection
Also FYI the classic texts
http://www.amazon.co.uk/Mathematics-Game-Programming-Computer-Graphics/dp/1435458869
http://www.amazon.co.uk/Real-Time-Collision-Detection-Interactive-Technology/dp/1558607323
Finally - the stackexchange "math" site always results in incredibly quick answers to easy or hard arithmetic woes! nobody on here knows any math ;-)