Jump to content
  • Advertisement
Sign in to follow this  
Keyframe

OpenGL Infinite or semi-infinite grid

This topic is 3767 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make an infinite ortographic grid (or a very large distance number, of course). Since I'm kind of rusty on OpenGL (and DirectX) I made a prototype with immediate mode in OpenGL. Not that it has to do anything with API of course. As you can see on the picture, I have a world 0,0 marked with bolder lines, and every fifth unit is marked - while regular units are normal width. I want to be able to pan through the world in infinite kind of fashion, if you know what I mean - so that center is where world center belongs to, etc. I suspect I need to represent my world first in a grid fashion and then draw it to the screen, but what happens if I want to have semi-infinite state of the world grid? Do I just assign long,long to the coordinates and be happy with that and if I ever come to the end of the world I wrap around? Also, how would I approach multi-resolution grid? That is, if I want to zoom in on the grid, I want to display finer level of units - say if I want to zoom in on one unit, it should display another five units of granulation, and so on - untill I get to a certain treshold. Anyways, what kind of data structures should I look into and how should I draw it out? Immediate mode here is just a prototype, a hack. As I'm aware, retained mode is what I should look into for production level. Grid prototype

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!