MeshLib Documentation
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
6
namespace
MR
7
{
8
17
template
<
typename
T>
18
AffineXf3<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
MRAffineXf.h
MRMatrix3.h
MR::lookAt
AffineXf3< T > lookAt(const Vector3< T > ¢er, const Vector3< T > &eye, const Vector3< T > &up)
computes rigid transformation xf
Definition
MRAffineXf3.h:18
MR
Definition
MRCameraOrientationPlugin.h:8
MR::AffineXf
Definition
MRMesh/MRAffineXf.h:14
MR::Vector3
Definition
MRMesh/MRVector3.h:19
MeshLib
source
MRMesh
MRAffineXf3.h
Generated by
1.11.0