0

This is the function:

lookat(vec3 eye, vec3 at, vec3 up)

As we all know, the up vector can be(0.0, 1.0, 0.0). It cannot be parallel to the observation vector n, or there will be somethingw wrong.

My question is how to calculate the up vector so that it passes through the point eye and is perpendicular to the n vector.

3
  • Read about the Cross product
    – Rabbid76
    Nov 22 '21 at 13:48
  • The Cross Product needs two vectors to get a result, but I only have one vector n.
    – ernesto
    Nov 22 '21 at 14:01
  • 1
    If you only have 1 vector there are infinite solutions.
    – Rabbid76
    Nov 22 '21 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.