diff --git a/examples/multi-viewport/example.cpp b/examples/multi-viewport/example.cpp index 3541d1de2..3bbd6c665 100644 --- a/examples/multi-viewport/example.cpp +++ b/examples/multi-viewport/example.cpp @@ -131,6 +131,10 @@ void reshape_viewports() viewports[1].reshape( 0,eff_h*height, eff_v*width,(1.-eff_h)*height); viewports[2].reshape( 0, 0, eff_v*width,eff_h*height); viewports[3].reshape(eff_v*width, 0,(1.-eff_v)*width,eff_h*height); + for(auto & vp : viewports) + { + vp.camera.m_aspect = (double)vp.width/(double)vp.height; + } } void reshape(int width,int height) diff --git a/examples/quicklook-mesh/Makefile b/examples/quicklook-mesh/Makefile index b36103f0f..f4a2bd9d3 100644 --- a/examples/quicklook-mesh/Makefile +++ b/examples/quicklook-mesh/Makefile @@ -2,10 +2,12 @@ # Seems that we unfortunately must use llvm or else we get issues trying to # include the Foundation headers -%CXX=llvm-g++ -%C=llvm-gcc -CXX=clang++-mp-3.4 -C=clang-mp-3.4 +#CXX=llvm-g++ +#C=llvm-gcc +CXX=clang++ +C=clang +#CXX=clang++-mp-3.4 +#C=clang-mp-3.4 CXXFLAGS += -stdlib=libc++ -std=c++11 EIGEN=/opt/local/include/eigen3/ diff --git a/include/igl/Camera.h b/include/igl/Camera.h index c4a7cf1b4..bd5e7dd93 100644 --- a/include/igl/Camera.h +++ b/include/igl/Camera.h @@ -351,8 +351,14 @@ inline void igl::Camera::look_at( Quaterniond a,b; a.setFromTwoVectors(Vector3d(0,0,-1),-F); b.setFromTwoVectors(a*Vector3d(0,1,0),proj_up); - m_rotation_conj = (a*b).conjugate(); + m_rotation_conj = (b*a).conjugate(); m_translation = m_rotation_conj * eye; + //cout<<"m_at_dist: "<eye().transpose()<at().transpose()<eye()-this->at()).normalized().transpose()<eye()).squaredNorm() < DOUBLE_EPS); assert((F-(this->eye()-this->at()).normalized()).squaredNorm() < DOUBLE_EPS); diff --git a/include/igl/draw_floor.cpp b/include/igl/draw_floor.cpp index fbb41d7bd..195bd03bb 100644 --- a/include/igl/draw_floor.cpp +++ b/include/igl/draw_floor.cpp @@ -10,12 +10,12 @@ #include "OpenGL_convenience.h" -static const int GridSizeX = 100; -static const int GridSizeY = 100; -static const float SizeX = 0.5f; -static const float SizeY = 0.5f; -IGL_INLINE void igl::draw_floor(const float * colorA, const float * colorB) +IGL_INLINE void igl::draw_floor(const float * colorA, const float * colorB, + const int GridSizeX, + const int GridSizeY) { + const float SizeX = 0.5f*100./(double)GridSizeX; + const float SizeY = 0.5f*100./(double)GridSizeY; // old settings int old_lighting=0,old_color_material=0; glGetIntegerv(GL_LIGHTING,&old_lighting); @@ -73,8 +73,12 @@ IGL_INLINE void igl::draw_floor() igl::draw_floor(grey,white); } -IGL_INLINE void igl::draw_floor_outline(const float * colorA, const float * colorB) +IGL_INLINE void igl::draw_floor_outline(const float * colorA, const float * colorB, + const int GridSizeX, + const int GridSizeY) { + const float SizeX = 0.5f*100./(double)GridSizeX; + const float SizeY = 0.5f*100./(double)GridSizeY; float old_line_width =0; // old settings int old_lighting=0,old_color_material=0; diff --git a/include/igl/draw_floor.h b/include/igl/draw_floor.h index 5118c3fa8..17f12d729 100644 --- a/include/igl/draw_floor.h +++ b/include/igl/draw_floor.h @@ -36,10 +36,18 @@ namespace igl // glPopMatrix(); // glDisable(GL_CULL_FACE); // - IGL_INLINE void draw_floor(const float * colorA, const float * colorB); + IGL_INLINE void draw_floor( + const float * colorA, + const float * colorB, + const int GridSizeX=100, + const int GridSizeY=100); // Wrapper with default colors IGL_INLINE void draw_floor(); - IGL_INLINE void draw_floor_outline(const float * colorA, const float * colorB); + IGL_INLINE void draw_floor_outline( + const float * colorA, + const float * colorB, + const int GridSizeX=100, + const int GridSizeY=100); // Wrapper with default colors IGL_INLINE void draw_floor_outline(); }