4 ms·
Yep, the up vector is not necessarily orthogonal to the direction vector (which is also called “look at” vector in OpenGL [1]). Another approach would be to set
by layoutIfNeeded 6y ago
Yep, the up vector is not necessarily orthogonal to the direction vector (which is also called “look at” vector in OpenGL [1]). Another approach would be to set
y = up.reject(direction).normalized()
where
a.reject(b) = a - b.project(a)
[1] https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml...