File: intro.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 (24 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <Imath/ImathMatrix.h>
#include <Imath/ImathVec.h>
#include <iostream>
#include <cassert>

int
main()
{
    const Imath::V3f v (3.0f, 4.0f, 5.0f);
   
    Imath::M44f M;
    const Imath::V3f t(1.0f, 2.0f, 3.0f);
    M.translate (t);

    Imath::V3f p;
    M.multVecMatrix(v, p);

    std::cout << "What's your vector, Victor? " << p << std::endl;

    Imath::V3f vt = v + t;
    assert (p.equalWithAbsError(vt, 1e-6f));

    return 0;
}