X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fview.cpp;h=8943abce36e7e2c0307fca0b4f9bea6ce24ab11f;hb=b0d402f30489b0618d21281781e1b8f683ed567b;hp=017a526df71b215ca192218116f79b3fd97c7178;hpb=1251ba0141983481181d8260523ff07f2cf200a0;p=r2c2.git diff --git a/source/3d/view.cpp b/source/3d/view.cpp index 017a526..8943abc 100644 --- a/source/3d/view.cpp +++ b/source/3d/view.cpp @@ -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(); }