Jump to content
  • Advertisement
Sign in to follow this  
tokaplan

Dash line problem

This topic is 4889 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

I'm rendering a simple line to a texture using DrawPrimitiveUP. But for some reason the line is rendered as a dash line. Any possible reasons?

Share this post


Link to post
Share on other sites
Advertisement
Could you post the code for:

(a) Vertex creation of the line
(b) DPU Call

This way, we may be able to figure out your problem [smile]

Share this post


Link to post
Share on other sites
float line[] =
{
vector.x, 0, vector.z,
vector.x, vector.y, vector.z
};

g_pd3dDevice->SetFVF( D3DFVF_XYZ );

g_pd3dDevice->DrawPrimitiveUP( D3DPT_LINELIST, 1, (const void*)&line, 3 * sizeof( float ) );

As you see, everything's quite common, I've done this a hundred times before ;)
Thank you

Share this post


Link to post
Share on other sites
That is unusual. Are your coordinates in vector correct? If the code is the exact same that you have used in the past, you may want to check your device renderstates.

If you continue to have problems, it maybe be a good idea to check out ID3DXLine. It's easier to use and heavily optimized, so it's probably a better choice.

Share this post


Link to post
Share on other sites
Make sure you set the texture to NULL before you render the line.

EDIT: What I mean is pDevice->SetTexture(0, NULL); :)

Share this post


Link to post
Share on other sites
Yes, I do set texture to NULL. I do not want to use ID3DXLine because as far as I understand it only works with screen space coordinates which is not what I need. It must be some render state, but I don't know which one, I've tried everything :(

Share this post


Link to post
Share on other sites
What version of the SDK are you using and what IDE? D3DLINEPATTERN or D3DRS_LINEPATTERN would specify dotted lines, but they were deleted in version 9.

edit: Also, have you updated your video drivers. They could easily be the problem.

Share this post


Link to post
Share on other sites
What else are you drawing and do other primitives draw fine? What is your near and far clipping planes? Other than that, I haven't got any other guesses.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Shouldn't you use linestrip in your drawing paramter instead of linelist.

Linelist draws a line between each pair of vertices in your vertexbuffer (creating a dashed line) while linestrip draws a continuous line connecting each vertex in your vertexbuffer.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!