Skip to main content
GameDev.net gamedev.net
🔒 Locked

Thick lines

Started by Maddibob Jun 2, 2006 at 10:35 AM 2 replies 1.8k views
Original Post
Maddibob
Maddibob
Does anyone know how to draw lines thicker than 1 pixel? I'm using DirectX 9 and drawing lines using POINTLIST. I don't have access to my code at the moment so can't show what I'm doing. I thought there might be a simple line thickness setting somwhere? Thanks
don
don
I'm guessing you meant LINELIST and not POINTLIST?

ID3DXLine allows you to specify the line width.
Maddibob
Maddibob
Sorry, yes, LINELIST. And thanks for your reply.

In my app, I need to be able to draw lines around selected objects.

Is it better to do this by:

a) drawing the object normally and then drawing in wireframe with, say, a plain white texture. Problem with this is that for a cube, for example, you get lines making up the diagonal parts of the polys.

b) maintaining a list of lines and drawing using a LINELIST.

Does anyone know anything about the performance of drawing LINELISTs? Is it comparable to drawing the object in wireframe? Without doing any tests, I'm inclined to think it'll be quicker to draw the object.

Thanks
don
don
You'd have to benchmark it. If you're drawing wireframe triangles, you can backface cull, but you'll be drawing diagonals on planar faces made up of multiple triangles that you wouldn't do when drawing a list of lines that make up the outline of the mesh.

I wrote some code a while back that generated an index buffer comprising a line list from an indexed list of triangles just to draw the outline of a mesh (removed diagonals). More on that can be found here.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.