Archived

This topic is now archived and is closed to further replies.

Xetrov

drawing a grid

Recommended Posts

How do I draw a massive grid on the x-y plane in the quickest way possible such that I can amove the camera in any direction that I please, whilst the grid remains in a horizontal position(to the world). Ahh i guess that didn''t make too much sense.... ok: I want to draw a grid, which extends from -infinity to +infinity in both the X and Y axes of my world. I tried to do this with GL_LINES but it just did not look right Would a texture be better?

Share this post


Link to post
Share on other sites
I''d think GL_LINES would work better and faster than texture mapping that large of an area. can you post your implimentation?




How many Microsoft employees does it take to screw in a light bulb?
None, they just declare drakness as a new standard.

Share this post


Link to post
Share on other sites
>> I want to draw a grid, which extends from -infinity to +infinity <<

using GL_LINES should be quick enough ( u can turn off a few states eg lighting/depth writes )
the key to doing it fast is only draw the lines that are on the screen, ie much smaller than infinity

Share this post


Link to post
Share on other sites
I think that using a texture would be faster:

If you use GL_LINES then every frame you have to pass about 400 points(for a 10x10 grid) to the graphics card.

If you use a texture, then u just upload it once, and only pass one quad every frame.

Share this post


Link to post
Share on other sites