# How to teach "shark" to swim

At first look at animated shark (2+19kb) (animated "tiny" shark).

Splines suit very well for 3D animation. To force "shark" to swim, "body" (next after "surface") R(u,v,w) splines can be used to bend smoothly all the heap of its points ("shark" contains ~4000 points) by limided number of control points. Where
R(u,v,w) = ∑∑∑ Bi(u)Bj(v)Bk(w) Pi,j,k ,     0 ≤ u, v, w ≤ 1 ,     0 ≤ i, j, k ≤ 3 .
We need just put an object into 0 ≤ u, v, w ≤ 1 box and transform it by means of 43 = 48 control points. If these 48 points are too much, we can use more simple S(u,v) or C(u) transformations (see below).

But as a VRML viewer takes several seconds to plot a complex spline-based model, therefore it is not evident that one can animate these objects in real time. Fortunately Bob Crispen showed us IFS Animated dolphin (8kb). To get this animation he used linear interpolation by the CoordinateInterpolator node between the famous three dolphins (originally 3DS models from the Avalon Repository). Therefore to get fast animation we shall take a nice IFS model, transform it in several intermediate positions and use linear interpolation further.

IFS Shark (19kb) is used for animation. I've exported spline-based Anto Matkovic's shark sPatch model as VRML file.

# Shark nonlinear morphing

 Shark morphing by a 1D Bezier spline. (I can't test morhping under "Contact"). Bend the spline box, then press the red sphere to transform the shark. Press the green sphere to print control points into VRML console panel. You can grab these points and insert they into your animation. I think it is clear intuitively how to bend the shark. To morph a model I used transformation
x' = Cx(u),     y' = y + Cy(u),     z' = z + Cz(u),     0 < u = x < 1,
where r (x, y, z), r' (x', y', z') are initial and transformed coordinates of the model correspondingly, Cx, y, z(u) are spline coordinates, x and u coincide.

I hope now you can yourself teach to swim even an iron axe :)

updated 5 March 2001