Graphics Reference
In-Depth Information
Extruding Objects for Streamlines
If you place a weightless ping-pong ball in a 3D flow field and trace where it
goes, the result will be a 3D streamline. Streamlines are useful in visualization
because they give an animation “snapshot” of what is happening in the field
and thus are good for helping viewers discern lowield paterns. Now imag-
ine that you are driving a small car along the streamline. The car has a direc-
tion in which it is traveling, and it feels like the centrifugal force is pushing
you to the outside of the curve you are currently traveling through. There are
mathematical terms for these directions. Let's name the curve you are driving
on in the original flow field P ( t ). The direction you are traveling is called the
tangent and is denoted by T ( t ). The direction that points to the center of the
curve is the normal , denoted by N ( t ), and a vector perpendicular to both of
these is the binormal , denoted by B ( t ). If you have the function P ( t ) describing
the curve and the function has first and second derivatives, you can get all
three of these quantities with the Frenet equations:
(
)
() =
()
Tt
normalize
normalize
Pt
,
(
)
() =
() × ′′ ()
Bt
Pt Pt
,
() =
(() × ()
Nt Bt
Tt .
If you have a discrete series of points for the curve instead of a continu-
ous curve, then you can still approximate P ( t ) by treating the curve as piece-
wise linear or perform some other interpolation through the points. For each
point on the curve, then, the parameter t is the fraction of the total distance that
this point is along the combination of linear pieces.
Together, these three vectors constitute a moving coordinate system, or
frame , along the curve. Knowing these characteristics of this curve, we can take a
simple object and extrude it along the curve with the following transformation:
x
y
z
Tx Nx Bx X
Ty Ny By Y
Tz Nz Bz
x
y
z
1
=
.
Z
0 001
1
In this matrix, ( x , y , z ) are the points on the original (unwarped) object and
Tx , Nx , Bx , etc., are the components of the tangent T , normal N , and binormal
B that make up the coordinate frame at ( X , Y , Z ). The point ( X , Y , Z ) is the point
in 3-space where we want the point ( x , y , z ) to be translated to after it has been
reoriented.
Search WWH ::




Custom Search