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
Working with universal coordinate system
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
Re: Working with universal coordinate system
I like your pot product
That must give interesting results...
Never mind.
Fridger
That must give interesting results...
Never mind.
Fridger
Re: Working with universal coordinate system
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
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