Graphics Reference
In-Depth Information
Let the plane equation be
ax
+
by
+
cz
=
d
Therefore, the surface normal
n
is given by
n
=
a
i
+
b
j
+
c
k
Let Qxyz be the nearest point on the plane to P. Therefore,
q
=
x
i
+
y
j
+
z
k
and
n
·
q
=
d
(4.12)
Let
−
QP
=
r
=
n
Therefore,
q
=
p
−
n
(4.13)
To find
q
, we need to find .
Using
n
, take the dot product of Eq. (4.13):
n
·
q
=
n
·
p
−
n
·
n
(4.14)
Substitute Eq. (4.12) in Eq. (4.14):
d
=
n
·
p
−
n
·
n
and
n
·
p
−
d
n
·
p
−
d
=
n
=
2
n
·
n
If
n
=
1
then
=
n
·
p
−
d
Q is given by
q
=
p
−
n
(4.15)