Working with universal coordinate system
Posted: 20.08.2009, 17:33
Hi,
I'm trying to figure out if the Observer is moving towards an object (e.g a star) or away from it. This is what I have so far. I not sure if the idea is correct.
I'm calculating a new orientation from from the stars position and the observers position : Quatd newOrientation = starPosition - myPosition;
Than I calculate the pot product: double potProduct= newOrientation.x * myOrientation.x + newOrientation.y * myOrientation.y + newOrientation.z * myOrientation.z; (UniversalCoord myPosition = observer.getPosition();)
If the pot product is negative the observer should be moving towards the object otherwise the observer should be moving away from the object.
Is this correct or is there a better way to do it?
Greetings,
Thomas
I'm trying to figure out if the Observer is moving towards an object (e.g a star) or away from it. This is what I have so far. I not sure if the idea is correct.
I'm calculating a new orientation from from the stars position and the observers position : Quatd newOrientation = starPosition - myPosition;
Than I calculate the pot product: double potProduct= newOrientation.x * myOrientation.x + newOrientation.y * myOrientation.y + newOrientation.z * myOrientation.z; (UniversalCoord myPosition = observer.getPosition();)
If the pot product is negative the observer should be moving towards the object otherwise the observer should be moving away from the object.
Is this correct or is there a better way to do it?
Greetings,
Thomas