Jengu
07-03-2006, 12:21 AM
I have a 2D space setup for a plot. I want the user to be able to 'pan' through the plot by holding down a mouse button and dragging. So the plot may exist over some insane range like 1 to 1 million in both directions, but the user is only seeing a 500x500 chunk at a time, and by dragging the mouse they're changing the chunk they're looking at (think of staring through a cylinder on top of a map laid out on a desk). There should always appear to be a grid in the background as the user pans.
Information known at runtime:
-(x,y) coordinate primary vertical line and horizontal line should go through (origin)
-amount of space between lines
Not known at runtime:
-How far out into space the user will pan.
The whole time, the user should have the illusion of panning over one contiguous grid. Since I won't know how far out they'll go at runtime, and it could be big, just drawing lots of lines over the total available space isn't feasible (the range they could pan over might be x=(0, 65535) y=(0, 65535) with spacing expected to be 10 in both directions, meaning 2*65535.5 lines to draw @_@
So I know I should only be drawing a small number of lines viewable where the user is currently panning over. I'm not sure how to do this avoiding immediate mode. Ideas?
Information known at runtime:
-(x,y) coordinate primary vertical line and horizontal line should go through (origin)
-amount of space between lines
Not known at runtime:
-How far out into space the user will pan.
The whole time, the user should have the illusion of panning over one contiguous grid. Since I won't know how far out they'll go at runtime, and it could be big, just drawing lots of lines over the total available space isn't feasible (the range they could pan over might be x=(0, 65535) y=(0, 65535) with spacing expected to be 10 in both directions, meaning 2*65535.5 lines to draw @_@
So I know I should only be drawing a small number of lines viewable where the user is currently panning over. I'm not sure how to do this avoiding immediate mode. Ideas?