drawing lines in 3D?

Started by
4 comments, last by Buckeye 13 years, 6 months ago
I'm adding lines to my 3D world like we see in 3D studio max. To draw lines I'm using a cylinder mesh and simply stretching/rotating it appropriately. That's all working fine but my problem is scale. Since it's 3D geometry rendering in perspective its size changes, from a distance it's small to invisible, up close it's huge.

I want to make it so the size of the line geometry stays the same. I tried toying around with orthographic projection but came up with nothing. Any ideas?
Advertisement
Just use the line list or line strip primitives (if your video card supports it).
So there's no way to do it effectively otherwise?
DrawPrimitive?

Or if D3D10/11, it appears you need to first set IASetPrimitiveTopology during the input assembler stage.

If XNA: linky.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

Quote:Original post by _meds
So there's no way to do it effectively otherwise?


Of course not.
I'm not familiar with 3D studio max. If you're talking about placing grid lines over the window that do not change with camera position, you can use D3DXLINE which draws lines with screen coordinates. It will appear to be an orthogrpahic grid over the view, whether the view is perspective or ortho.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement