www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 6ddc2d7d8f83be9a98ca231a25cb6a345e6a5fc9
parent d9dcbdb206e07e95aaa997733db67a284484172e
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Tue, 10 Jan 2012 13:07:45 +0100

BUG.

Diffstat:
Mgeometry/quad.cpp | 2++
Mgeometry/triangle.cpp | 2++
Mmain.cpp | 7+++++--
Mrules/chose.cpp | 2+-
4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/geometry/quad.cpp b/geometry/quad.cpp @@ -126,5 +126,7 @@ Vertex Quad::randomPoint(int seed, int n) const { float Quad::surface() const { Triangle ne(c[NW], c[NE], c[SE]); Triangle sw(c[SE], c[SW], c[NW]); + std::cout << sw[LEFT] << " " << sw[TOP] << " " << sw[RIGHT] << std::endl; + std::cout << "{" << ne.surface() << " " << sw.surface() << "}" << std::endl; return ne.surface() + sw.surface(); } diff --git a/geometry/triangle.cpp b/geometry/triangle.cpp @@ -59,5 +59,7 @@ Vertex Triangle::randomPoint(int seed, int n) const { float Triangle::surface() const { float hauteur = Segment(c[TOP], (c[TOP] - c[LEFT]).projectOn(c[RIGHT] - c[LEFT])).length(); float base = Segment(c[LEFT], c[RIGHT]).length(); + std::cout << "Triangle = " << c[LEFT] << " " << c[TOP] << " " << c[RIGHT] << std::endl; + std::cout << "Triangle : b=" << base << " h=" << hauteur << " " << (c[TOP] - c[LEFT]).projectOn(c[RIGHT] - c[LEFT]) << std::endl; return (base * hauteur) / 2.f; } diff --git a/main.cpp b/main.cpp @@ -5,7 +5,7 @@ int main() { // Générer une tile de base std::cout << "Initial seed = " << Chose::initialSeed << std::endl; - float size = 10; + float size = 20000; Vertex ne(size, size, 0); Vertex se(size, 0, 0); Vertex sw(0, 0, 0); @@ -14,6 +14,9 @@ int main() { c->triangulation(); c->updateAABB(); - new View(c); + //std::cout << Triangle(se, sw, nw).surface() << std::endl; + std::cout << Quad(Vertex(10,10,0), Vertex(10,0,0), Vertex(0,0,0), Vertex(0,10,0)).surface() << std::endl; + + //new View(c); return 0; } diff --git a/rules/chose.cpp b/rules/chose.cpp @@ -145,4 +145,4 @@ void Chose::drawAABB() { ); } -unsigned int Chose::initialSeed = random_seed(); +unsigned int Chose::initialSeed = 1032729551;//random_seed();