tests/vector.cc
author Radek Brich <radek.brich@devl.cz>
Sat, 08 Dec 2007 12:37:45 +0100
branchpyrit
changeset 28 ffe83ca074f3
parent 0 3547b885df7e
child 84 6f7fe14782c2
permissions -rw-r--r--
smooth triangles (aka Phong shading) extend Python binding to support vertex normals and smooth triangles make bunny.py and realtime_dragon smooth, and fix other demos for new triangle constructor add Vector::operator/=

#include "vector.h"

int main() {
	Vector3 a(1, 2, 3);
	cout << "=== Vector3 test ===" << endl;
	cout << "a = " << a << endl;
	Vector3 b(2, 3, 2);
	cout << "b = " << b << endl;
	
	cout << "a + b = " << a + b << endl;
	cout << "b - a = " << b - a << endl;
	cout << "dot(a,b) = " << dot(a,b) << endl;
	cout << "cross(a,b) = " << cross(a,b) << endl;
	cout << "a * 2 = " << a * 2 << endl;
	cout << "3 * b = " << 3 * b << endl;
	cout << "-a = " << -a << endl;

	cout << "a.mag() = " << a.mag() << endl;
	cout << "a.unit() = " << a.unit() << endl;
	cout << "a.unit().mag() = " << a.unit().mag() << endl;

	return 0;
}