FACT++  1.0
void Q3DCameraWidget::resizeGL ( int  cWidth,
int  cHeight 
)
protectedvirtual

Reimplemented from BasicGlCamera.

Definition at line 238 of file Q3DCameraWidget.cc.

References BasicGlCamera::pixelSize, BasicGlCamera::shownSizex, BasicGlCamera::shownSizey, and BasicGlCamera::viewSize.

239  {
240  glViewport(0,0,cWidth, cHeight);
241  glMatrixMode(GL_PROJECTION);
242  glLoadIdentity();
243  GLfloat windowRatio = (float)cWidth/(float)cHeight;
244  if (windowRatio < 1)
245  {
246 // windowRatio = 1.0f/windowRatio;
247  gluPerspective(40.f, windowRatio, 1, 100);
248 // gluOrtho2D(-viewSize, viewSize, -viewSize*windowRatio, viewSize*windowRatio);
249  pixelSize = 2*viewSize/(float)cWidth;
250  shownSizex = 2*viewSize;
251  shownSizey = 2*viewSize*windowRatio;
252  }
253  else
254  {
255  gluPerspective(40.f, windowRatio,1, 8);
256 // gluOrtho2D(-viewSize*windowRatio, viewSize*windowRatio, -viewSize, viewSize);
257  pixelSize = 2*viewSize/(float)cHeight;
258  shownSizex = 2*viewSize*windowRatio;
259  shownSizey = 2*viewSize;
260  }
261  glMatrixMode(GL_MODELVIEW);
262  }