Dear Friends Please give me suggestions why is it coming breaking the model. isn't my code correct ??
My drawscene and reshape functions are like this
Please give some comment where it's till going wrong. ?? Thanks a lot for reply. SujanCode:void CRevolutionProjView::DrawScene(CDC *pDC) { wglMakeCurrent(pDC->m_hDC, m_hrc); //--------------------------------- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); glPushMatrix(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); if (wd <= ht) glOrtho(-range, range, -range*ht/wd, range*ht/wd, -range, range); else glOrtho(-range*wd/ht, range*wd/ht, -range, range, -range, range); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(trans[0], trans[1], trans[2]); glRotatef(rot[0], 1.0f, 0.0f, 0.0f); glRotatef(rot[1], 0.0f, 1.0f, 0.0f); glRotatef(rot[2], 0.0f, 0.0f, 1.0f); glScalef(zoomFactor,zoomFactor,zoomFactor); glCallList(object); glCallList(axes); glPrintX("X"); glPrintY("Y"); glPrintZ("Z"); glPopMatrix(); glFlush(); SwapBuffers(pDC->m_hDC); wglMakeCurrent(NULL, NULL); } void CRevolutionProjView::Reshape(CDC *pDC, int w, int h) { AR = (double)w/(double)h; wd = w; ht = h; wglMakeCurrent(pDC->m_hDC, m_hrc); //--------------------------------- glViewport (0, 0, (GLsizei) w, (GLsizei) h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode (GL_MODELVIEW); wglMakeCurrent(NULL, NULL); }




Reply With Quote