Greg If the path is a straight line, say in the x direction, you can get backspin by increasing the angle of PITCH at each key frame. The interpolator than produces a change in the angle perpendicular to the path. I have been known to confuse the pitch and bank. I think I have chosen the correct one. Try it and see.
If the path is curved, like swing on a cricket ball then this might not work since the axis need to change direction to keep it perpendicular to the track. Some thoughts If you have two successive position vectors v1 and v2, in order of time, and c = v2 - v1 is along the spline path. If b is to be perpendicular to c then the coords of B are( c2.b3 - c3.b2, c3.b1 - c1.b3, c1.b2 - c2.b1). This infinitely many vectors all perpendicular but if you choose, say, the y-coord to be zero you can find the ratio between b1 and b3 then the set of vectors in the x-z plane. Normalising to magnitude of 1 will give you the unit vector about which the spin takes place. I have not worked out the next step, how to get the angles of transform for a combination of pitch and bank. Sorry, it I just spotted that we know the direction of the path from the heading no need to calculate from successive vectorsof the position., but the axis argument is still works. More time might produce a result. Peter Strachan ----- Original Message ----- From: "Mr greg baboolal" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 19, 2002 12:54 AM Subject: [JAVA3D] Axis of Rotation > Hi, I wonder if someone can guide me with this. > > I have a ball object which I want to rotate about it's > x-axis (simulating back-spin). > > I am using the RotPosPathInterpolator which has the > correspoding quats to simulate the spin upon its > target TransformGroup. > > The target TG is set with a Transform3D. > > The rpi transform3D in an empty constructor. > > The problem I am having is that when the ball moves > and spins about the x-axis I need to be perpendicular > to the direction it is travelling in. > > When I rotated the target TG to face the direction it > is supposed to travel in, the TG's cordinate system > was also rotated so that the bounds of my billiard > table (a seperate TG) no longer take effect, as they > are now un-aligned. > > I have tried various rotations of the TG's, including > some experiments with AxisAngle4f. > > If someone can help, it would be very much > appreciated. > > -Greg > > ps: The following snippets of code show how the ball's > TG and the rpi is being instantiated: > > ball TG: > > Transform3D sphereT3D = new Transform3D(); > sphereT3D.setTranslation( position ); > > TransformGroup sphereTG = new TransformGroup > (sphereT3D ); > sphereTG.addChild( createSphere( canvas, imageName ) > ); > > rpi: > RotPosPathInterpolator(alpha, target,new > Transform3D(), knots, quats, positions ); > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".