As the name knots implies, a useful way (Business web site)

As the name knots implies, a useful way to visualize the interpolator is as a string stretched taut between a number of points. Each point is called a knot, and as well as having an Alpha value (time) when the interpolator is to reach the knot it also possesses position, scale, and rotation information (a pose). The distance between knots defines the speed at which the interpolation between values must occur. Knots are specified using float values between 0 and 1, where 0 is the knot used at Alpha value 0 and 1 is the knot used at Alpha time 1. The array of knot values defines a mapping from Alpha value to pose information. The knot values must increase from 0 to 1 in the knot array. //define the knots array that map from Alpha to pose index float[] knots = {0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.6f, 0.8f, 0.9f, 1.0f}; //create array with 9 poses: containing rotation, position //and scale values Quat4f[] quats = new Quat4f[9]; Point3f[] positions = new Point3f[9]; float[] scales = {0.2f, 0.5f, 0.8f, 2.3f, 5.4f, 0.6f, 0.4f, 0.2f, 0.1f}; //define the rotation values for each of the 9 poses quats[0] = new Quat4f(0.3f, 1.0f, 1.0f, 0.0f); quats[1] = new Quat4f(1.0f, 0.0f, 0.0f, 0.3f); quats[2] = new Quat4f(0.2f, 1.0f, 0.0f, 0.0f); quats[3] = new Quat4f(0.0f, 0.2f, 1.0f, 0.0f); quats[4] = new Quat4f(1.0f, 0.0f, 0.4f, 0.0f); quats[5] = new Quat4f(0.0f, 1.0f, 1.0f, 0.2f); quats[6] = new Quat4f(0.3f, 0.3f, 0.0f, 0.0f); quats[7] = new Quat4f(1.0f, 0.0f, 1.0f, 1.0f); quats[8] = quats[0]; //define the positions for each of the 9 poses positions[0]= new Point3f(0.0f, 0.0f, -1.0f); positions[1]= new Point3f(1.0f, -2.0f, -2.0f); positions[2]= new Point3f(-2.0f, 2.0f, -3.0f); positions[3]= new Point3f(1.0f, 1.0f, -4.0f); positions[4]= new Point3f(-4.0f, -2.0f, -5.0f); positions[5]= new Point3f(2.0f, 0.3f, -6.0f); positions[6]= new Point3f(-4.0f, 0.5f, -7.0f); positions[7]= new Point3f(0.0f, -1.5f, -4.0f); positions[8]= positions[0]; //create the interpolator and pass Alpha, TransformGroup, //knots, and pose information RotPosScalePathInterpolator rotPosScalePathInterplator = new RotPosScalePathInterpolator( alpha, tg, new Transform3D(), knots, quats, positions, scales ); As you can see, the rotation angles are specified using the Quat4fclass. The Quat4fclass specifies a rotation as a quaternion. The following is a description of quaternions, taken from the excellent Matrix and Quaternion FAQ. The FAQ can be found online and it currently maintained by Andreas Junghanns at http://www.cs.ualberta.ca/~andreas/math/matrfaq_latest.html. Quaternions extend the concept of rotation in three dimensions to rotation in four dimensions. This avoids the problem of gimbal-lock and allows for the implementation of smooth and continuous rotation. In effect, 202
We recommend high quality webhost to host and run your jsp application: christian web host services.

Leave a Reply