void CalcObsCoordSystem(VectorR3 s, VectorR3 &x, VectorR3 &y) { // Given: sight vector s from observer -> target: // usefull: VectorR3::CrossProduct(a, b) calculates VectorR3 orthogonal to a and b // obtain x-axis. x is orthogonal to s and to the artificial up-vector VectorR3 up(0, 1, 0); // ... // make sure: if s points into the positiv z-halfspace, // then x is supposed to point to the positiv x-halfspace (to the right) // if s points into the negative z-halfspace, // then x is supposed to point to the negativ x-halfspace (to the left) // ... // obtain y-axis // ... // make sure: y should point into the positive y-halfspace (point upwards) // // remember: but the y-axis of your window points downwards, // because pixel (0,0) is the upper left one // ... } // CalcObsCoordSystem