]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/view.cpp
Make use of View3D in engineer
[r2c2.git] / source / 3d / view.cpp
index 017a526df71b215ca192218116f79b3fd97c7178..8943abce36e7e2c0307fca0b4f9bea6ce24ab11f 100644 (file)
@@ -10,6 +10,8 @@ namespace R2C2 {
 
 View3D::View3D(Layout3D &l, unsigned w, unsigned h):
        layout(l),
+       width(w),
+       height(h),
        pipeline(w, h)
 {
        pipeline.set_camera(&camera);
@@ -22,6 +24,7 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h):
        camera.set_up_direction(GL::Vector3(0, 0, 1));
        // Y+, 60° down
        camera.set_look_direction(GL::Vector3(0, 0.5, -0.866));
+       camera.set_aspect(float(width)/height);
 
        view_all();
 }