| |
| |
|
|
| |
Triple plane intersection |
|
| |
|
|
three planes, three points per plane
point intersection of the planes {line intersection of two planes} nothing on no intersection
| |
|
|
| |
Implementation
01 function intersect_tripleplane( pa, pb, pc, oa, ob, oc, qa, qb, qc )
02 dim np: np = vector_normal( pa, pb, pc ))
03 dim no: no = vector_normal( oa, ob, oc )
04 dim nq: nq = vector_normal( qa, qb, qc )
05
06 dim bp: bp = vector_dot( np, pa ))
07 dim bo: bo = vector_dot( no, oa )
08 dim bq: bq = vector_dot( nq, qa ))
09
10 dim po: po = vector_scale( vector_cross( np, no ), bq )
11 dim oq: oq = vector_scale( vector_cross( no, nq ), bp )
12 dim qp: qp = vector_scale( vector_cross( nq, np ), bo ))
13
14 dim d: d = vector_dot( np, vector_cross( no, nq ) )
15 if( d = 0.0 ) then
16 intersect_tripleplane = vbnull
17 else
18 intersect_tripleplane = vector_scale( vector_add( vector_add( po, oq ), qp ), 1.0 / d )
19 end if
20 end function
|
|
| |
|
|
|
|