PDA

View Full Version : What is the best way to draw a grid or debug lines?



hashbrown
04-29-2017, 01:07 PM
I'd like to debug my opengl application in a more visual way, what would you all recommend is the best route for drawing a grid like:

https://s18.postimg.org/pe5rn3sg5/grid.png (https://postimg.org/image/pe5rn3sg5/)

or lines that help visualize the normal's of a cube's face, or even draw the frustum of my camera. I'm not sure if I should draw the lines from my application code like any other mesh I make, or just create the lines in the shader.

For example, those axis arrows I'm imagining are made of a mesh that is individually transformed and reused from my application, and then colored blue, green and red in the shader. The grid I'm thinking is another mesh?

I'm not looking for code just advise that might point me towards the direction. Hope this makes sense.