Link to home
Create AccountLog in
Avatar of rraghu77
rraghu77

asked on

glOrtho problems - Wrap ?

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.
ASKER CERTIFIED SOLUTION
Avatar of NovaDenizen
NovaDenizen

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer