c++ - gluLookAt in reshape function -
this how reshape func looks like
`void reshape(int w, int h) { const float ar = (float)w/(float)h; glviewport(0,0,w,h); glmatrixmode(gl_projection); glloadidentity(); gluperspective(20.0, ar, 1.0, 60.0); // fovy, aspect ratio, znear, zfar glmatrixmode(gl_modelview); glloadidentity(); glulookat(7,7,7,0,-1,0,0,1,0); }`
when rotate view , resize window camera comes position set in glulookat. should change, when want camera stay in rotated place after resize?
i bet have glu @ in display. are. wiping in next frame after reshape.
anyway better saving window size in int w, h;
, have glulookat in display or update func. or infact can leave viewport call there.
i recommend looking @ glfw rather glut when fixed.
Comments
Post a Comment