diff options
author | Julian T <julian@jtle.dk> | 2020-08-06 19:21:49 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-08-06 19:22:37 +0200 |
commit | 4348cc9581bfea05359485c5d2d074132d0271da (patch) | |
tree | 0c6d92a90ac4cf9acd326f632dcdc962ddca013a /app/main.cpp | |
parent | 893176a0b18a2281abe09def716ccc3db5583c3f (diff) |
Renders scenes with a single hardcoded light and green objects
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/app/main.cpp b/app/main.cpp index 15262f2..64e413a 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -3,14 +3,31 @@ #include <qpushbutton.h> #include "mainwindow.hpp" +#include "vector.hpp" +#include <scene.hpp> +#include <render.hpp> +#include <object.hpp> using namespace std; int main(int argc, char *argv[]) { QApplication a(argc, argv); + Scene scn; + scn.addShape(new Sphere(Vec3d(2, 6, -1), 1)); + scn.addShape(new Sphere(Vec3d(0, 4, -1), 1.3)); + scn.addShape(new Sphere(Vec3d(-2, 5, -2), 1.3)); + //scn.addShape(new Sphere(Vec3d(0, 7, 0), 0.5)); - MainWindow main; + scn.addShape(new Plane(Vec3d(0, 0, 0), Vec3d(0, 1, 0))); + scn.addShape(new Plane(Vec3d(0, 10, 0), Vec3d(0, 1, 0))); + scn.addShape(new Plane(Vec3d(0, 0, -5), Vec3d(0, 0, 1))); + scn.addShape(new Plane(Vec3d(-5, 0, 0), Vec3d(1, 0, 0))); + scn.addShape(new Plane(Vec3d(5, 0, 0), Vec3d(1, 0, 0))); + + Renderer render(scn, Vec3d(0, 5, 4), Vec3d(0, 5, 0), 500, 500); + + MainWindow main(render); main.show(); return a.exec(); |