PDA

View Full Version : How to enlarge..??



rakesh_thp
09-17-2009, 12:23 AM
Hello,

I want to read a text file containing Lat/long values and display them on the OpenGL canvas..

For this i have first converted Lat/Long to OpenGL xy coordinates.. and displayed them accordingly..

It works fine.. But After converting the values to be displayed lies in the following range

x-axis: 0 - 2
y-axis: 2 - 4

and my screen projection is


glOrtho(0, canvas_width, 0, canvas_height, -1, 1);

So it appears as small as a point... I want it to be displayed at the center of the screen as big as the screen size..

how do i do this..??

Thanks in advance..

ZbuffeR
09-17-2009, 02:32 AM
then use glOrtho(0, 2, 2, 4, -1, 1);

MaxH
09-17-2009, 10:03 AM
There's really no need to convert your lat-lon values to values between 0 and 2, or 2 and 4. Let's say your lon values range from -180 to +180 and lat ranges from -90 to +90. You can display the data directly with something like -

glOrtho (-200, 200, -100, 100, -1, 1);

or

glOrtho (-200, 200, -200, 200, -1, 1);

depending on the aspect ratio of your canvas.

rakesh_thp
09-21-2009, 02:39 AM
glOrtho (-200, 200, -100, 100, -1, 1);

or

glOrtho (-200, 200, -200, 200, -1, 1);

If i use this then, also the projected values, after plotting will be displayed very small... Coz all values lies between the range of 72 and 73... I want the displayed objects to be directly displayed at the center of the screen with whatever lat lon range they have...

Thanks..