This came up in the Games forum, I thought I'd post it here since it has a great deal of mathematical relevance.

Given two 3D Position Vectors indicating the positions of two objects on a 3D grid, is it possible to create a quaternion to describe the absolute rotation required for object 1 to be pointing at object 2?

And if so, how?

I've found about 3 or 4 poorly described code samples trying to do this, but they all either error or produce undesirable results, or break in certain conditions (such as when object 1 is at the center point of the grid).