I am trying to draw (in tikz-3d) a perpendicular from a point to a line that is not a coordinate axis. The question is how to find a projection of this point. I need some analog to tikz-euclide:
\tkzDefPointBy[projection=onto B--C](A) \tkzGetPoint{H1}
but in 3D.
The question is above, but this is the "code" that doesn't give me what I want. The goal is to draw the orthocenter of the triangle ABC in space.
\documentclass{article}
\usepackage{tikz,tkz-euclide,tikz-3dplot}
\usetkzobj{all}
\usetikzlibrary{intersections}
\begin{document}
\tdplotsetmaincoords{70}{100}
\begin{tikzpicture}[tdplot_main_coords, scale=1]
%============ Object Definitions ============================
\coordinate [label= above:$A$] (A) at (0, 0, 3);
\coordinate [label= right:$B$] (B) at (0, 4, 0);
\coordinate [label= below left:$C$] (C) at (4, 0, 0);
\coordinate [label= below left:$D$] (D) at (0, 0,0);
\tkzDefPointBy[projection=onto B--C](A) \tkzGetPoint{H1}
\tkzDefPointBy[projection=onto A--C](B) \tkzGetPoint{H2}
\tkzInterLL(A,H1)(B,H2) \tkzGetPoint{H}
%============ Denotations ====================================
\tkzLabelPoint[below right](H1){$H_1$}
\tkzLabelPoint[left](H2){$H_2$}
\tkzMarkRightAngle[size=0.2](C,H1,A)
\tkzMarkRightAngle[size=0.2](C,H2,B)
\tkzMarkRightAngle[size=0.2](A,D,B)
\tkzMarkRightAngle[size=0.2](A,D,C)
\tkzMarkRightAngle[size=0.2](C,D,B)
%============ Drawing ======================================
\draw [dash pattern=on 5pt off 5pt] (D)--(B);
\draw [dash pattern=on 5pt off 5pt] (D)--(H);
\draw [thick,draw=white,double=black,double distance= 1pt](A)--(H1);
\draw [thick,draw=white,double=black,double distance= 1pt](C)--(A);
\draw (A)--(B);
\draw (B)--(C);
\draw (D)--(A);
\draw (D)--(C);
\draw (B)--(H2);
\tkzDrawPoints(A,B,C,D,H1,H2,H)
\end{tikzpicture}
\end{document}
I used tikz-euclid notation to make it clear what I want. The lines
\tkzDefPointBy[projection=onto B--C](A) \tkzGetPoint{H1}
\tkzDefPointBy[projection=onto A--C](B) \tkzGetPoint{H2}
are supposed to be substituted by something that works in 3D.