I looked at another post asking about the best way to draw lines, but I wondered if there might be a better way to do a grid than to draw 10,000 lines.
You see I need a flat grid, 100 units wide by 100 units deep. I also need to be able to zoom out to see all of the lines, but zoom in enough to see about 5 square units.
My original thought was to draw all the lines individually and change their thickness based on camera distance. However I am away from my programming computer and haven't been able to check performance.
My next thought was to draw a wireframe plane, 100x100, but then I remembered that it would all be triangulated, and it seems like a wasted 20,000 tri's.
Next I thought about a plane that would cover the area, but rather than being 20,000 tris, would use a repeated texture that I could swap on the fly to adjust resolution as the camera moves in and out. Again though, I am not sure how that kind of texture repetition would affect performance.
These are the only ideas that I came up with. If you have a better idea or can comment on the performance of my ideas, please offer them. The grid is an essential part of my game, but certainly not the most important. I can't afford to have my grid be a resource hog! Thank-you very much for all your help!
Best way to draw a grid?
-
DarkDepths
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada
-
Lonesome Ducky
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
psychophoniac
- Posts: 101
- Joined: Wed Dec 03, 2008 5:33 pm
- Location: ger
here is a very nice one.
http://irrlicht.sourceforge.net/phpBB2/ ... ditor+grid
http://irrlicht.sourceforge.net/phpBB2/ ... ditor+grid
i love skateboarding!
-
DarkDepths
- Posts: 126
- Joined: Sun Apr 02, 2006 1:21 am
- Location: Canada
