what's the best way to show an image in opengl
up to know I have used glDrawPixels but since my image is a large geotiff
one, I'm getting some horrible results for example:
this is the code used for zoom extent:
void COpenGLControl::ZoomFullExtent()
{
GLint iViewport[4];
glGetIntegerv(GL_VIEWPORT, iViewport);
glPixelZoom((GLfloat) iViewport[2] / (GLfloat)width,(GLfloat)
iViewport[3] / (GLfloat)height);
}
and this is the result. since the image is an square one, it's not a good
result.
and this is the code used for zoom in:
void COpenGLControl::FixedZoomIn()
{
glPixelZoom(2.0f, 2.0f);
}
but it does zoom in operation just one time and when I again click on the
button the zoom in is not done I think it is because that when I call
COpenGLControl::FixedZoomIn for an instance of the class COpenGLControl
infact the openGL window is zoommed not the contents in it.
anyway I have heard about texture mapping and how to zoom by changing z of
the camera point but I didn't find good tutorial.
I want to customize the class COpenGLControl for my purpose and I do need
such a tutorial.
No comments:
Post a Comment