Jump to content
  • Advertisement
Sign in to follow this  
dorfsrule

Linestrip thickness

This topic is 4425 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to change the thickness of a linestrips' lines using DirectX 9x? I found one post here that said it wasn't possible with DirectX 8. I have a 2D hex map and I want to outline a few of the hexes with thicker lines. I can get it to outline the hexes but I want the outline to be a bit thicker. Thanks in advance. Rob

Share this post


Link to post
Share on other sites
Advertisement
As far as I know, DirectX doesn't support line widths (other than 1, of course)

Your best bet is to write a line-drawing function that takes two points and builds a thin quad connecting them. The good part of this is that you can then have texture mapped lines :)

Share this post


Link to post
Share on other sites
ID3DXLine::SetWidth.

There is no such control drawing lines with DrawPrimitive(D3DPT_LINELIST,...).

Share this post


Link to post
Share on other sites
Thanks for the replies. I am using c# so the ID3DXLine::SetWidth wouldn't work.

What I ended up doing was just drawing 2 hexes with one slightly inside the other. Essentially I doubled my vertices from 7 to 14. Since I only need to do it for a few hexes, the added verts don't cause any noticeable slowdowns. Here is the vertice code I used:

public CustomVertex.PositionColored[] GetHexOutlineVerts()
{
//line strip with colors not textures
CustomVertex.PositionColored[] verts = new CustomVertex.PositionColored[14];
verts[0] = new CustomVertex.PositionColored(0.0f,2.0f,1.0f,Color.Yellow.ToArgb());
verts[1] = new CustomVertex.PositionColored(-1.732051f,1.0f,1.0f,Color.Yellow.ToArgb());
verts[2] = new CustomVertex.PositionColored(-1.732051f,-1.0f,1.0f,Color.Yellow.ToArgb());
verts[3] = new CustomVertex.PositionColored(0.0f,-2.0f,1.0f,Color.Yellow.ToArgb());
verts[4] = new CustomVertex.PositionColored(1.732051f,-1.0f,1.0f,Color.Yellow.ToArgb());
verts[5] = new CustomVertex.PositionColored(1.732051f,1.0f,1.0f,Color.Yellow.ToArgb());
verts[6] = new CustomVertex.PositionColored(0.0f,2.0f,1.0f,Color.Yellow.ToArgb());
verts[7] = new CustomVertex.PositionColored(0.0f,1.9f,1.0f,Color.Yellow.ToArgb());
verts[8] = new CustomVertex.PositionColored(-1.7f,0.9f,1.0f,Color.Yellow.ToArgb());
verts[9] = new CustomVertex.PositionColored(-1.7f,-0.9f,1.0f,Color.Yellow.ToArgb());
verts[10] = new CustomVertex.PositionColored(0.0f,-1.9f,1.0f,Color.Yellow.ToArgb());
verts[11] = new CustomVertex.PositionColored(1.7f,-0.9f,1.0f,Color.Yellow.ToArgb());
verts[12] = new CustomVertex.PositionColored(1.7f,0.9f,1.0f,Color.Yellow.ToArgb());
verts[13] = new CustomVertex.PositionColored(0.0f,1.9f,1.0f,Color.Yellow.ToArgb());

return verts;
}//end gethexverts

My numbers are pretty arbitrary. I make the assumption of a normal hex having a 4 height and then using the geometry to come up with the other dimensions. The inside hex just uses slightly smaller numbers. Frankly I was surprised this worked the first time since As far as I know you have to do every thing counterclockwise. In this case I am doing things counterclockwise but it is doing two revolutions if that makes sense. Any further comments are appreciated. I am always looking for tips. If anyoen wants to see a screenshot then let me know.

Rob
dorfsruleATyahoo.com

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!