MeshLib
 
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{
8
17template<typename T>
18AffineXf3<T> lookAt( const Vector3<T>& center, const Vector3<T>& eye, const Vector3<T>& up )
19{
20 const auto f = (center - eye).normalized();
21 const auto s = cross( f, up ).normalized();
22 const auto u = cross( s, f );
23
24 return AffineXf3f{
25 Matrix3f{ s, u, -f },
26 Vector3f{ -dot( s, eye ), -dot( u, eye ), dot( f, eye ) }
27 };
28}
29
30} // namespace MR
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
AffineXf3< T > lookAt(const Vector3< T > &center, const Vector3< T > &eye, const Vector3< T > &up)
computes rigid transformation xf
Definition MRAffineXf3.h:18
Definition MRCameraOrientationPlugin.h:7
Definition MRMesh/MRAffineXf.h:14
Definition MRMesh/MRVector3.h:19