MAPaint Technical Report:
Lines of Intersection

next up previous contents
Next: 3D Orientation Feedback Up: Geometry Previous: Fixed Point Constraints

Lines of Intersection

To make the painting easier on an undistorted image the arbitrary sections are not displayed with any sort of orthographic or perspective projection but as seen from the viewing angle. This can be somewhat confusing and to help navigation the line of intersection of the view that has the current ``input-focus'' (usually when the cursor is in the view window) with all other views is displayed and will move as the controls are adjusted. To determine the line of intersection is straightforward geometry and requires solving a set of three simultaneous equations to find a point in each view that is common to both.

For two given planes p1 and p2 with viewing angles $(\theta_1, \phi_1)$and $(\theta_2, \phi_2)$ respectively we want to establish the angle, $\alpha$, and a point, ${\bf p} = (p_X, p_Y)$, of the line of intersection of plane 1 in plane 2. With these two quantities we can then draw the line of intersection in plane 2:

\begin{displaymath}(y - p_y) = tan(\alpha) (x - p_x).
\end{displaymath}

If ${\bf n_1}$ is the normal to viewing plane 1 and ${\bf n_2}$ is the normal to viewing plane 2 then the line of intersection, which must lie in both planes, is parallel to the vector ${\bf n_1} \wedge {\bf n_2}$. To establish the angle in plane 2 we rotate this vector to plane 2 coordinates, ${\bf l} = R_2 ({\bf n_1} \wedge {\bf n_2})$, and

\begin{displaymath}tan(\alpha) = \frac{l_y}{l_x}.
\end{displaymath}

To calculate a point of intersection of the two planes we solve for the point of intersection of a line in plane 1 with plane 2. A line in plane 1 which must intersect plane 2 is a normal to the line of intersection. If ${\bf f_1}$ and d1 are the fixed point and distance parameters of plane 1 then the normal to the line of intersection which passes through the origin in plane 1 is

\begin{displaymath}{\bf r} = {\bf n_1} \wedge ({\bf n_1} \wedge {\bf n_2}) s_1
+ {\bf f_1} + {\bf n_1} d_1,
\end{displaymath} (20)

where s1 is a scalar parameter. Plane 2 can defined in terms of a vector parameter ${\bf s_2} = (x_2, y_2, d_2)^T$ where x2, y2 are free parameters and d2 is the distance parameter of plane 2 by the equation

\begin{displaymath}{\bf r} = R_2^{-1} {\bf s_2} + {\bf f_2}.
\end{displaymath} (21)

The point of intersection between this plane and the line in plane 1 is found by solving

\begin{displaymath}R_2^{-1} {\bf s_2} + {\bf f_2} = {\bf n_1} \wedge ({\bf n_1} \wedge {\bf n_2}) s_1
+ {\bf f_1} + {\bf n_1} d_1,
\end{displaymath} (22)

for the parameters s1, x2 and y2. This vector equation results in a set of three simultaneous equations which can be expressed in matrix form

\begin{displaymath}A \left( \begin{array}{c}
x_2 \\
y_2 \\
s_1 \end{array} \right) = {\bf B}
\end{displaymath} (23)

where ${\bf B} = {\bf f_1} - {\bf f_2} + {\bf n_1} d_1 - {\bf n_2} d_2$and

\begin{displaymath}A = \left(\begin{array}{ccc}
(R_2^{-1})_{11} & (R_2^{-1})_{12...
...} \wedge ({\bf n_1} \wedge {\bf n_2}))_z
\end{array} \right).
\end{displaymath}

The equations are solved in the paint program using standard linear equations algorithms.


next up previous contents
Next: 3D Orientation Feedback Up: Geometry Previous: Fixed Point Constraints

Richard Baldock
1998-06-05