MeshLib C++ Docs
Loading...
Searching...
No Matches
MRAffineXf3.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMatrix3.h"
4#include "MRAffineXf.h"
5
6namespace MR
7{
10
11
20template<typename T>
21AffineXf3<T> lookAt( const Vector3<T>& center, const Vector3<T>& eye, const Vector3<T>& up )
22{
23 const auto f = (center - eye).normalized();
24 const auto s = cross( f, up ).normalized();
25 const auto u = cross( s, f );
26
27 return AffineXf3f{
28 Matrix3f{ s, u, -f },
29 Vector3f{ -dot( s, eye ), -dot( u, eye ), dot( f, eye ) }
30 };
31}
32
33}
AffineXf3< T > lookAt(const Vector3< T > &center, const Vector3< T > &eye, const Vector3< T > &up)
computes rigid transformation xf
Definition MRAffineXf3.h:21
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRVector3.h:33