/* Last edited on 2011-09-13 03:18:45 by stolfilocal */ /* _*_ latin-1 _*_ */ /* Bezier model of human body */ /* Coordinate axes are X = forwards, Y = right, Z = up. */ #ifndef bzb_foot_H #define bzb_foot_H #include #include void bzb_joint_bend ( r3_t *q, double x0, double y0, double z0, double z1, double frac, r3_t u, r3_t w ); /* Applies to point {q} the morphing that results from bending a joint. Assumes that the axis of the unbent joint is vertical, has horizontal coordinates {x0,y0}, and extends vertically from {z0} to {z1}. First, each planar horizontal cut through the joint is twisted around the joint's axis, by an angle that ranges linearly from 0 at {z1} to a certain angle {tang} at {z0}. Then, the joint is bent. Bending preserves the length of the joint's axis, and its upper position and direction, but turns it into an arc of circle whose center {xc,yc,zc} lies somewhere on the plane {z=z1}. Each planar horizontal cut through the joint is mapped isometrically to a planar cut perpendicular to the bent axis, without any extra twist. The bending center is chosen so that the {w} vector is perpendicular to the bottom slice of the joint after bending (that is, the direction of the bent axis at its bottom end). The twist angle is chosen so that the {+x} direction on that slice, before bending, becomes as parallel as possible to the {u} vector after bending. The point {q} is assumed to be rigidly attached to the slice of the joint that lies {frac} of the way from {z1} to {z0}. In particular, if {frac <= 0}, {q} is not changed; if {frac >= 1}, {q} is moved as if it were part of a rigid object attached to the bottom of the joint. */ #endif