chethan
05-10-2012, 06:47 AM
Hi
go thru this screen co-ordinate creation snippet :
// CMFC_View drawing in MFC.
void CMFC_View::OnDraw(CDC* pDC)
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//if(m_3D)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
////select the viewing volume
if(perspectView)
{
gluPerspective(26.0f, aspect_ratio, 1.0f, 10000.0f);
gluLookAt(0.0f,0.0f,m_width*2,0.0f,0.0f,0.0f,0.0f, 1.0f,0.0f);
} else {
glOrtho(-1*m_width,m_width,-1*m_height,m_height,-1*1000,1000);
}//// switch back to the modelview matrix and clear it
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
GetGLMat(m); //Creates 16 elements for Transformations and holds the data.
glMultMatrixf(m); // Multiplies to the MODELVIEW matrix for changes in display.
glPushMatrix();
DisplayGL();
glPopMatrix();
glFlush();
SwapBuffers(m_pDC->GetSafeHdc());
}
My questions are
1. I am creating a orthognal viewport is this good for Modification of vertices in world screen?
2. If yes give me suggestions on how to modify the Vertices in world screen after transformations?
3. If any other formats to control world screen co-ordinate system, welcome?
go thru this screen co-ordinate creation snippet :
// CMFC_View drawing in MFC.
void CMFC_View::OnDraw(CDC* pDC)
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
//if(m_3D)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
////select the viewing volume
if(perspectView)
{
gluPerspective(26.0f, aspect_ratio, 1.0f, 10000.0f);
gluLookAt(0.0f,0.0f,m_width*2,0.0f,0.0f,0.0f,0.0f, 1.0f,0.0f);
} else {
glOrtho(-1*m_width,m_width,-1*m_height,m_height,-1*1000,1000);
}//// switch back to the modelview matrix and clear it
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
GetGLMat(m); //Creates 16 elements for Transformations and holds the data.
glMultMatrixf(m); // Multiplies to the MODELVIEW matrix for changes in display.
glPushMatrix();
DisplayGL();
glPopMatrix();
glFlush();
SwapBuffers(m_pDC->GetSafeHdc());
}
My questions are
1. I am creating a orthognal viewport is this good for Modification of vertices in world screen?
2. If yes give me suggestions on how to modify the Vertices in world screen after transformations?
3. If any other formats to control world screen co-ordinate system, welcome?