Commited that file with incorrect size for automated test.

This commit is contained in:
Godzil
2020-03-02 23:16:17 +00:00
parent 0be3236a03
commit a1c53fc9cc

View File

@@ -34,9 +34,13 @@ Shape *fir_branch()
Group *ret = new Group(); Group *ret = new Group();
double length = 2; double length = 2;
double radius = 0.025; double radius = 0.025;
#if 0
int segments = 20; int segments = 20;
int perSegment = 24; int perSegment = 24;
#else
int segments = 5;
int perSegment = 24;
#endif
Cylinder *branch = new Cylinder(); Cylinder *branch = new Cylinder();
branch->minCap = 0; branch->minCap = 0;
branch->maxCap = length; branch->maxCap = length;
@@ -77,7 +81,7 @@ Shape *fir_branch()
Point p3 = Point(0, yTip, needleLenght); Point p3 = Point(0, yTip, needleLenght);
needle = new Triangle(p1, p2, p3); needle = new Triangle(p1, p2, p3);
needle->setTransform(rotationY(yAngle)); needle->setTransform(rotationY(yAngle));
needle->material.colour = Colour(0.26, 0.36, 0.16); needle->material.colour = Colour((1.0 / (double)perSegment)*i /*0.26*/, 0.36, /*0.16*/ (1. / (double)segments) * y);
needle->material.specular = 0.1; needle->material.specular = 0.1;
subGroup->addObject(needle); subGroup->addObject(needle);
} }
@@ -132,7 +136,7 @@ int main()
w.addLight(&light4); w.addLight(&light4);
Sphere light4Sphere = Sphere(); Sphere light4Sphere = Sphere();
light4Sphere.dropShadow = false; light4Sphere.dropShadow = false;
light4Sphere.setTransform(translation(-1, -2, -16) * scaling(.4, .4, .4)); light4Sphere.setTransform(translation(-1, -2, -6) * scaling(.4, .4, .4));
light4Sphere.material.colour = Colour(0.5, 1, 0.5); light4Sphere.material.colour = Colour(0.5, 1, 0.5);
light4Sphere.material.ambient = 0.6; light4Sphere.material.ambient = 0.6;
light4Sphere.material.diffuse = 0; light4Sphere.material.diffuse = 0;
@@ -179,7 +183,7 @@ int main()
s = fir_branch(); s = fir_branch();
s->setTransform(translation(-1, -1, 0) * rotationY(0.349) * rotationX(-1.5708) * translation(0, -0.5, 0)); s->setTransform(translation(-1, -1, 0) * rotationY(0.349) * rotationX(-1.5708) * translation(0, -0.5, 0));
w.addObject(s); w.addObject(s);
/*
s = fir_branch(); s = fir_branch();
s->setTransform(translation(-1, 1, 0) * rotationY(0.349) * rotationX(-1.5708) * translation(0, -0.5, 0)); s->setTransform(translation(-1, 1, 0) * rotationY(0.349) * rotationX(-1.5708) * translation(0, -0.5, 0));
w.addObject(s); w.addObject(s);
@@ -219,7 +223,7 @@ int main()
s = fir_branch(); s = fir_branch();
s->setTransform(translation(1.5, -0.5, 0) * rotationY(-0.1754) * rotationX(0.087) * rotationX(-1.5708) * translation(0, -0.5, 0)); s->setTransform(translation(1.5, -0.5, 0) * rotationY(-0.1754) * rotationX(0.087) * rotationX(-1.5708) * translation(0, -0.5, 0));
w.addObject(s); w.addObject(s);
*/
/* ----------------------------- */ /* ----------------------------- */
@@ -233,7 +237,7 @@ int main()
/* Set the camera */ /* Set the camera */
Camera camera = Camera(800, 600, 1.047); Camera camera = Camera(40, 30, 1.047);
camera.setTransform(viewTransform(Point(0, 0, -4), camera.setTransform(viewTransform(Point(0, 0, -4),
Point(0, 0, 0), Point(0, 0, 0),
Vector(0, 1, 0))); Vector(0, 1, 0)));