r/GraphicsProgramming • • May 22 '20

Question Best practices for 3D(or 2D) axes

Hello all. What are the best practices for 3D or 2D axes rendering for viewers. You all know those axes in bottom-left of the viewer or somewhere else over everything.

  • Rendering to a texture and then to a quad?

  • Rendering to a 1mx1mx1m Voxel away from the camera?

Looking forward to get inspired.

0 Upvotes

7 comments sorted by

8

u/[deleted] May 22 '20

Drawing simple lines?

-2

u/sariug May 22 '20

Can be lines, cylinders cones whatever. With text (xyz) or not. The question is to how to render it in the best way.

8

u/[deleted] May 22 '20

That's what I said. Render them as simple lines.

-8

u/sariug May 22 '20

I try to mean the proper way of rendering. Like how it shall be the best practice(rather than mesh shape). Im not sure if u get the question 🤔

11

u/zuzerial May 22 '20

Yeah, that's what they're saying. Say you're working with OpenGL: when you call glDrawArrays(), pass in GL_LINES as the mode instead of, say, GL_TRIANGLES

1

u/machinegod420 May 24 '20

The proper way of rendering is whatever works for you. Just drawing lines for the axes works just as well as some other fancy way

5

u/BigJewFingers May 23 '20

Render it last, directly to your main render target without z buffer reading. Use a modified camera matrix with a super close near plane so that it doesn't get clipped and you don't get z-fighting on your main geometry. If your camera's field of view is too big it's going to look really distorted.