Forum: Animation


Subject: Making a 3D Motion Path in Poser 4

VK opened this issue on Jul 04, 2005 ยท 16 posts


VK posted Mon, 04 July 2005 at 5:08 PM

There exist different versions of the code. And frankly, I've lost track of the versions when I left the unfinished project last year. Basically, there is a simple code variant. According to my notes, the latest version seems to be used in model "BCPolyCode3.cr2". It's made of three parametric functions ("Bernstein" polynomials) to compute the (xyz) coordinates of a point P on the Bezier curve, and the derivatives of the curve. The code is simple and straightforward. The formulas for the first Bezier patch are Qx = 3 * (x1 - x0) Rx = 3 * (x2 - x1) - Qx Sx = x3 - x0 - Qx - Rx Qy = 3 * (y1 - y0) Ry = 3 * (y2 - y1) - Qy Sy = y3 - y0 - Qy - Ry Qz = 3 * (z1 - z0) Rz = 3 * (z2 - z1) - Qz Sz = z3 - z0 - Qz - Rz where Q, R, S are coefficients for the polynomials, (x0,y0,z0) are the coordinates of the first knot "A", (x1,y1,z1) are the coordinates of the first CP "aa", (x2,y2,z2) are the coordinates of the second CP "bb", and (x3,y3,z3) are the coordinates of the second knot "B". The parametric functions are cubic polynomials, the parameter "p" moves from 0 to 1 for each Bezier patch: x(p) = Sx * p^3 + Rx * p^2 + Qx * p + x0 y(p) = Sy * p^3 + Ry * p^2 + Qy * p + y0 z(p) = Sz * p^3 + Rz * p^2 + Qz * p + z0 The derivatives are then: dx(p) = 3 * Sx * p^2 + 2 * Rx * p + Qx dy(p) = 3 * Sy * p^2 + 2 * Ry * p + Qy dz(p) = 3 * Sz * p^2 + 2 * Rz * p + Qz. Since the first knot "A" is always at coordinates (0,0,0), factors x0, y0, z0 can be removed from the formulas. Unfortunately, the auto-bank mechanism of this model is not very reliable. The slope of the curve based on the dy/dx and dz/dx derivatives is analytically accurate. But the calculation yields poor result under some conditions, as you will easily notice if you try out the "BCPolyCode3.cr2" model. Errors become obvious when you set up a curved 3D path like the irregular helix shown in the picture.