As Joerg and I stated, there is no reason to use two TransformGroups.
Using separate TransformGroups only wastes memory and performance.

Perhaps you aren't understanding what a tranform does.  The rotation has
nothing to do with the positioning (i.e. rotating it doesn't move it in
a different direction it just changes the object's orientation).

I think you'll find it easier if you keep the position, speed and
orientation in separate variables (don't fetch them from the transform!)
and just use basic geometry to calculate the new position and
orientation and then apply it using the TransformGroup.

- John Wright
Starfire Research

Jaakko Holopainen wrote:
Ill post the code here, so this is what i do every 1/100 second:

  // get current transform
  Transform3D transform = new Transform3D();
  m_transformGroup.getTransform(transform);  // the TransformGroup1
explained in the earlier post

  // get current facing
  Transform3D facing = new Transform3D();
  m_transformGroupObject.getTransform(facing); // the TransformGroup2
explained in the earlier post

  // check thrust states
  if (!m_thrustForward && !m_thrustBack) m_accelerateVector.z = 0.0f;
  else if (m_thrustForward && m_accelerateVector.z < 0.1f)
m_accelerateVector.z += 0.005f;
  else if (m_thrustBack && m_accelerateVector.z > - 0.05f)
m_accelerateVector.z -= 0.001f;

  // TODO: apply the combined effect of the facing & accelerate vectors to
the speed vector
  // for the moment apply only thrust
 //  THIS IS THE PART WHERE I NEED SOME HELP
  m_speedVector.z += m_accelerateVector.z;

  // apply the speedvector to this transform
  Transform3D movement = new Transform3D();
  movement.setTranslation(m_speedVector);
  transform.mul(movement);

  // update the new transform
  m_transformGroup.setTransform(transform);

===========================================================================
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".

Reply via email to