Working on worlds.

It's currently crashing.
This commit is contained in:
Godzil
2020-02-19 18:05:48 +00:00
parent efe46e2864
commit a82b67faa4
11 changed files with 195 additions and 15 deletions

View File

@@ -9,7 +9,26 @@
#include <worldbuilder.h>
#include <world.h>
#include <sphere.h>
#include <light.h>
#include <material.h>
#include <transformation.h>
DefaultWorld::DefaultWorld()
{
Light *l = new Light(POINT_LIGHT, Point(-10, 10, -10), Colour(1, 1, 1));
Sphere *s1 = new Sphere();
Sphere *s2 = new Sphere();
Material s1Mat = Material();
s1Mat.colour = Colour(0.8, 1.0, 0.6);
s1Mat.diffuse = 0.7;
s1Mat.specular = 0.2;
s1->setMaterial(s1Mat);
}
s2->setTransform(scaling(0.5, 0.5,0.5));
this->addLight(l);
this->addObject(s1);
this->addObject(s2);
}