How do I get a Unit Vector Representing the Facing of a Quaternion?

27 Views Asked by At

I have a point that has a rotation, the quaternion $(.5, .5i, .5j, -.5k)$. If I place this at the origin of a unit sphere, how can I project a vector from the origin to the point on the unit sphere that the point is facing?

I tried to find this using the axis of rotation, but it doesn't seem to be working. I'm not really sure what I'm doing during these operations, or more importantly: why these operations specifically. I'm just randomly attempting things, so I have no confidence my attempts are even remotely in the right direction. I suppose my next attempt would be to take a unit vector and apply the quaternion rotation to it, but that seems to be making the problem more complex.

Is this possible or should I be applying the quaternion to a unit vector? If two things are facing the same way, but one of them is flipped, I expect the two unit vectors to be the same. Being upside down doesn't change the direction the point is facing. (ie. $(.5, .5i, .5j, -.5k)$ and $(.5, -.5i, .5j, .5k)$ would both result in vector $(0x,0y,-1z)$)

I have tried implementing the solution in How to rotate unit vectors and unit quaternions by unit quaternions? but doing those operations with $(.5, -.5i, .5j, .5k)$ is giving me $(−0.25,0.25,−0.25)$