Fall2006.CSCI299VectorsExtra History

Hide minor edits - Show changes to output

Added lines 1-8:

!!!Follow the Leader

You have two objects, ob1 and ob2 moving in space, and you wish to ob2 to follow ob1.

1) Easier set ob2.velocity to ob1.velocity - instantenous turn

2) smooth turn - get angle diff between ob1.vel and ob2.vel. get cross product of ob1.vel and ob2.vel. set ob2.vel to rotate (ob2.vel, min(angle_diff, maxTurningCapacity), crossProduct)