Page 1 of 1

Working with universal coordinate system

Posted: 20.08.2009, 17:33
by Dandelion
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

Re: Working with universal coordinate system

Posted: 20.08.2009, 17:37
by t00fri
I like your pot product ;-)

That must give interesting results...

Never mind.

Fridger

Re: Working with universal coordinate system

Posted: 18.09.2009, 16:44
by Dandelion
Hello,

what exactly is the orientation of the observer? i thought it is the vector in which the observer is moving or looking!! And it doesn't seem to normalize correctly.

Quatd myOrientation = observer.getOrientation();
myOrientation.normalize();
double test2 = sqrt(pow(myOrientation.x,2.0) + pow(myOrientation.y,2.0) + pow(myOrientation.z,2.0));

new test2 should be 1 but it isn't

Thomas