#include #include using namespace std; #include "Vector.h" int main() { Vec3 V1(1.0f, 1.0f, 1.0f), V2(1.0f, -1.0f, -1.0f), VResult; cout << "V1 -> " << V1 << endl; cout << "V2 -> " << V2 << endl; cout << "V1 * 2 - 3 * V2 -> " << V1*2 - 3*V2 << endl; cout << "V1 Dot V2 -> " << Vec3Dot(V1, V2) << endl; Vec3Cross(VResult, V1, V2); cout << "V1 Cross V2 -> " << VResult << endl; Vec4 V3(1.0f, 2.0f, 3.0f, 4.0f), V4(-1.0f, -2.0f, -3.0f, -4.0f), VResult2; cout << "V3 -> " << V3 << endl; cout << "V4 -> " << V4 << endl; cout << "V3 * 2 - 3 * V4 -> " << V3*2 - 3*V4 << endl; cout << "V3 Dot V4 -> " << Vec4Dot(V3, V4) << endl; Vec4Lerp(VResult2, V3, V4, 0.5f); cout << "(V3 + V4) * 0.5 -> " << (V3 + V4) * 0.5f << endl; cout << "Linear Interpolation(V3, V4, 0.5) -> " << VResult2 << endl; cout << "10 random points on the unit sphere." << endl; int i; for(i=0;i<10;i++) { V1.StdRandomNormal(); cout << V1 << '\t' << "Length -> " << V1.Length() << endl; } }