299 |
\subsection{Drawing the shape} |
\subsection{Drawing the shape} |
300 |
|
|
301 |
Recall that the torn shape is defined as the intersection |
Recall that the torn shape is defined as the intersection |
302 |
of a surface $(x,y,f(x))$ and a cutting plane, rotated and |
of a surface $(x,y,f(x,y))$ and a cutting plane, rotated and |
303 |
stretched around the tearing line to match desired bounds on the paper. |
stretched around the tearing line to match desired bounds on the paper. |
304 |
|
|
305 |
Because the rotation and stretching are affine operations, |
Because the rotation and stretching are affine operations, |
379 |
Pre-computed edge width: interpolated between |
Pre-computed edge width: interpolated between |
380 |
3 or 4 stored angles. |
3 or 4 stored angles. |
381 |
|
|
382 |
|
A circle (or ellipse, depending on how much the cutting plane is |
383 |
|
stretched on screen) is moved inside the cutting plane so that |
384 |
|
it always touches the surface, but never crosses it. |
385 |
|
The center of the circle draws the outer edge of the border. |
386 |
|
The radius of the circle determines the line width. |
387 |
|
|
388 |
|
If the cutting plane is then moved (without rotating it) |
389 |
|
around the surface, the outer edges corresponding to each |
390 |
|
position of the cutting plane draw a complete surface over |
391 |
|
the original surface. |
392 |
|
The same algorithm that draws the inner edge can then be |
393 |
|
used to draw the outer edge by using a texture storing the new surface. |
394 |
|
However, the outer edge surface is different for different |
395 |
|
orientations of the cutting plane and for different line widths. |
396 |
|
|
397 |
|
An application generally uses only one or a few different |
398 |
|
slopes of the cutting plane so there is no problem in storing |
399 |
|
these discrete choices in different textures. |
400 |
|
However, the tearout shape can rotate, requiring surfaces |
401 |
|
for all tearing directions in the paper. |
402 |
|
We compute the outer surfaces for a small number of different |
403 |
|
tearing directions (45 or 60 degress apart) and store them |
404 |
|
in the components of a texture. |
405 |
|
The surface corresponding to a a tearing direction between |
406 |
|
two stored angles is computed |
407 |
|
by linearly interpolating between the two components of the |
408 |
|
texture using a dot product with GL\_NV\_register\_combiners. |
409 |
|
|
410 |
|
The interpolation works better for non-vertical cutting planes. |
411 |
|
For a vertical cutting plane, the circle may fit in a narrow valley |
412 |
|
only in a certain angle, making large changes in the outer surface |
413 |
|
over small changes of angle. On the other hand, when the cutting |
414 |
|
plane is closer to horizontal, there can be no such gaps, |
415 |
|
because the surface is defined as a displacement from a horizontal plane. |
416 |
|
|
417 |
|
|
418 |
Non-photorealistic line-width through mip-mapping. |
Non-photorealistic line-width through mip-mapping. |
419 |
%Pyramidal parametrics, Lance Williams (mipmap) ref. |
%Pyramidal parametrics, Lance Williams (mipmap) ref. |
420 |
cite rip-maps |
cite rip-maps |
421 |
|
|
422 |
|
|
423 |
|
|
424 |
Magnification |
Magnification |
425 |
|
|
426 |
|
|
446 |
Curved lines: \\ |
Curved lines: \\ |
447 |
- dicing \\ |
- dicing \\ |
448 |
- projective texture mapping (may need to increase dicing to |
- projective texture mapping (may need to increase dicing to |
449 |
prevent discontinuities between segments) |
prevent discontinuities between segments). |
450 |
|
XXX: if curvature is not continuous (e.g., a quarter circle corner |
451 |
|
on straight edges) dicing the tearing line does not prevent discontinuities: |
452 |
|
straight lines have no perspective, but all circle sections have |
453 |
|
perspective distortion relative to the ratio of outer and inner radii. |
454 |
|
|
455 |
|
|
456 |
\section{Example applications} |
\section{Example applications} |
457 |
|
|