|
|
opengl + zoom
hello groups.
sorry to ask again but i m not getting the solution.
i have loaded the tiff image but not able to zoom the image.
my code is as follows.
int main(int argc, char** argv)
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
TIFF *tif;
char emsg[1024];
int i;
tif = TIFFOpen("vancouver.tif", "r");
if (TIFFRGBAImageBegin(&img, tif, 0, emsg)) {
npixels = img.width * img.height;
raster = (uint32 *) _TIFFmalloc(npixels * sizeof(uint32));
if (raster != NULL) {
if (TIFFRGBAImageGet(&img, raster, img.width, img.height) == 0)
{
TIFFError(filename, emsg);
//exit(1);
}
}
TIFFRGBAImageEnd(&img);
} else {
TIFFError(filename, emsg);
exit(1);
}
imgwidth = img.width;
imgheight = img.height;
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glutInitWindowSize(imgwidth, imgheight);
glutCreateWindow(argv[0]);
glutReshapeFunc(reshape);
glutDisplayFunc(display);
init();
glutMainLoop();
return 0;
}
and using glDrawPixel() to display the image.
and glPixelZoom(); and glCopyPixel() to zoom the image.
this image is a map.
now i want to zoom this image . i want to select the perticular portion
of the image and zoom it, just same as in google earth or wikimapia.
can anybody tell me how to zoom the image . which functions shall i
use ?
or can give some sample code.
plz help to solve this problem.
thanx in advance.
|
|
0
|
|
|
|
Reply
|
aaliya.zarrin (19)
|
12/15/2006 10:22:33 AM |
|
ruby wrote:
> now i want to zoom this image . i want to select the perticular
> portion of the image and zoom it, just same as in google earth
> or wikimapia. can anybody tell me how to zoom the image .
> which functions shall i use ?
Don't use glDrawPixels. It's old and will be probably removed
from OpenGL 3. Use textures instead. Those are usually more
performant, too. Especially selecting a subimage is far easier
with textures.
> or can give some sample code.
Look up texturing tutorials. You might also want to have a look
at ARB_texture_rectangle extension (you will hardly find a card
that can't do this).
Wolfgang Draxinger
--
E-Mail address works, Jabber: hexarith@jabber.org, ICQ: 134682867
|
|
0
|
|
|
|
Reply
|
Wolfgang
|
12/15/2006 10:29:18 AM
|
|
actually i m using opengl with wxWidgets for creating collecting the
rectangle (selecting the section for zooming image)coordinates on mouse
click event.
i want the area inside the rectangle should get zoomed.
i m not much familiar with texturing?
shall tiff image can be directly read as texture image?
|
|
0
|
|
|
|
Reply
|
ruby
|
12/15/2006 11:35:32 AM
|
|
ruby wrote:
> i want the area inside the rectangle should get zoomed.
> i m not much familiar with texturing?
> shall tiff image can be directly read as texture image?
It makes no difference if you pass the data to glDrawPixels or to
glTexImage2D. The in memory format is the same. Disable
mipmaping, then there's nothing additional you have to bother
with.
Wolfgang Draxinger
--
E-Mail address works, Jabber: hexarith@jabber.org, ICQ: 134682867
|
|
0
|
|
|
|
Reply
|
Wolfgang
|
12/15/2006 11:45:46 AM
|
|
but still i m not getting !!!!!!!!!!
|
|
0
|
|
|
|
Reply
|
ruby
|
12/18/2006 3:54:32 AM
|
|
|
4 Replies
305 Views
(page loaded in 0.055 seconds)
Similiar Articles: opengl + zoom - comp.graphics.api.openglhello groups. sorry to ask again but i m not getting the solution. i have loaded the tiff image but not able to zoom the image. my code is as follow... how to zoom tiff image? - comp.graphics.api.openglhi all. can any body tell how to zoom the tiff image using open gl or give some link to sample examples for the same. thanx in advance. ... Application to zoom and pan through a very large image - comp ...Hello, Is there an Opengl application for simply viewing a large image ? It would enable the user to zoom in and pan and tilt in a smooth =>30 fps u... Draw constant size object regardless of zoom - comp.graphics.api ...Hi, I want to draw a load of spheres that are drawn the same size no matter how much the user zooms in or out of the scene (zooming is done by transla... panning in OpenGL - comp.graphics.api.openglopengl + zoom - comp.graphics.api.opengl panning in OpenGL - comp.graphics.api.opengl I draw a 3D shape that the user can pan/ orbit/zoom. On this 3D shape there are a ... [WinXP SP1, MFC] WM_MOUSEWHEEL not received - comp.graphics.api ...Hi, In a MDI application (XP SP1), I have 4 OpenGL views. I want the user to be able to zoom in/out using the mouse wheel. I receive all mouse events... using OpenGL/GLUT for realtime data plotting - comp.graphics.api ...You can even implement GUIs in OpenGL, so you could zoom >> into different parts of your data, all in real-time. > > first of all, thanks for your fast reply. Rotate axes label in 3D graphics - comp.soft-sys.math.mathematica ...panning in OpenGL - comp.graphics.api.opengl Draw constant size object regardless of zoom - comp.graphics.api ... I draw a 3D ... comp.soft-sys.matlab ... opengl + zoom ... Setting default zoom factor in notebooks - comp.soft-sys.math ...Hi, I've this problem, I often work with zoom factor 125% in my ... glDrawPixels problem - comp.graphics.api.opengl Setting default zoom factor in notebooks - comp ... can't rotate axes objects w/ Windows 7 - comp.soft-sys.matlab ...panning in OpenGL - comp.graphics.api.opengl can't rotate axes objects w/ Windows 7 - comp.soft-sys.matlab ... opengl + zoom - comp.graphics.api.opengl can't rotate axes ... True OpenGL Zooming - CodeProjectTrue zooming on a perspective view...; Author: pepito sbarzeguti; Updated: 12 Feb 2002; Section: OpenGL; Chapter: Multimedia; Updated: 12 Feb 2002 OpenGL FAQ / 8 Viewing and Camera Transforms, and Using gluLookAt()It's helped several new OpenGL programmers. 8.040 How do I implement a zoom operation? A simple method for zooming is to use a uniform scale on the ModelView matrix. 7/26/2012 1:55:16 AM
|
|
|
|
|
|
|
|
|