glOrtho problems - Wrap ?

Posted on 2006-03-23
Last Modified: 2013-12-06
I have a COM component which draws a WorldMap on CView and the point values on the world map ranges from (x1, x2, y1, y2) (-180, 180, -90, 90). The component has the facility to zoom pan etc. Also since this is a world map the edges are wrapped around, for eg after +180 and next point is 180. So I set the full ortho as (-180, 180, -90, 90) for the whole worldmap. In zoom/pan i change the ortho values.
The problem starts when the pan window hits the 'edges' of the world map so the ortho values may become (170, -170, -20, 20). Since x1 > x2 the drawing gets inverted/mirrored etc and opengl does not support an ortho setting like glOrtho(170, -170, 10, -10, -1000, 1000). I am at my wits end to find a elegant solution.
Any help would be greatly appreciated.
Question by:rraghu77
    1 Comment
    LVL 22

    Accepted Solution

    I think you're depending on OpenGL for some application-level functionality it's not going to give you.  You need to manage the scaling and wraparound in your own code, without calling glOrtho on every update.  glOrtho just helps you do a simple linear coordinate mapping.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
    Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now