Results 1 to 4 of 4

Thread: How to enlarge..??

  1. #1
    Member Contributor
    Join Date
    Jun 2009
    Posts
    60

    How to enlarge..??

    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

    Code :
    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..

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: How to enlarge..??

    then use glOrtho(0, 2, 2, 4, -1, 1);

  3. #3
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Los Angeles
    Posts
    374

    Re: How to enlarge..??

    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.

    Am I doing your homework for you?

  4. #4
    Member Contributor
    Join Date
    Jun 2009
    Posts
    60

    Re: How to enlarge..??

    Code :
    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..

Similar Threads

  1. Help : enlarge a triangle strip
    By oumind in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-10-2008, 02:50 AM
  2. enlarge the view volume's depth
    By jyoung77 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-19-2005, 11:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean