Skip to content

Instantly share code, notes, and snippets.

@anunyin
Created October 25, 2013 10:17
Show Gist options
  • Save anunyin/7152526 to your computer and use it in GitHub Desktop.
Save anunyin/7152526 to your computer and use it in GitHub Desktop.
vec3 object1(15.2f, 0.0f, -12.0f);
vec3 object2(0.0f, 0.0f, 0.0f);
// Set the forward vector to align with the vector between these two positions.
// Effectively having the second object "look at" the first.
object2.SetForward(object1 - object2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment