Vectors To VRML Events - (5)

Some Code


  // Rotation from 'def' to 'direction'
  rotA  = new SFRotation(defDirection,direction);
  // Adjust 'up' vector, defUp = yAxis
  up    = rotA.multVec(yAxis);
  // Fix orientation with respect to 'up'
  rotB  = new SFRotation(direction.cross(up),
                         direction.cross(yAxis));
  // Combine both
  orientation = rotA.multiply(rotB);