File: Plane3.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 (21 lines) | stat: -rw-r--r-- 439 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
#include <Imath/ImathPlane.h>
#include <cassert>

void
plane3_example()
{
    Imath::V3f a (1.0f, 0.0f, 0.0f);
    Imath::V3f b (0.0f, 1.0f, 0.0f);
    Imath::V3f c (0.0f, 0.0f, 1.0f);

    Imath::Plane3f p (a, b, c);

    Imath::V3f n (1.0f,  1.0f,  1.0f);
    n.normalize();

    assert (p.normal == n);

    Imath::V3f o (0.0f, 0.0f, 0.0f);
    float d = p.distanceTo (o);
    assert (Imath::equalWithAbsError (d, -0.57735f, 1e-6f));
}