File: Euler.cpp

package info (click to toggle)
imath 3.1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,468 kB
  • sloc: cpp: 44,687; ansic: 171; sh: 153; python: 60; makefile: 32
file content (25 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <Imath/ImathEuler.h>
#include <Imath/ImathMatrixAlgo.h>
#include <cassert>

void
euler_example()
{
    int i, j, k;
    
    Imath::Eulerf xyz (Imath::Eulerf::XYZ);
    xyz.angleOrder (i, j, k);
    assert (i == 0 && j == 1 && k == 2);

    Imath::Eulerf xzy (Imath::Eulerf::XZY);
    xzy.angleOrder (i, j, k);
    assert (i == 0 && j == 2 && k == 1);

    Imath::Eulerf e1 (0.0f, 0.0f, 0.1f + 2 * M_PI);
    Imath::Eulerf e2 (0.0f, 0.0f, 0.1f);

    e1.makeNear (e2);
    Imath::V3f v = e2.toXYZVector();
    assert (v.equalWithAbsError (Imath::V3f (0.0f, 0.0f, 0.1f), 0.00001f));
}