Dash line problem
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?
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]
(a) Vertex creation of the line
(b) DPU Call
This way, we may be able to figure out your problem [smile]
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
{
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
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.
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.
Make sure you set the texture to NULL before you render the line.
EDIT: What I mean is pDevice->SetTexture(0, NULL); :)
EDIT: What I mean is pDevice->SetTexture(0, NULL); :)
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 :(
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.
edit: Also, have you updated your video drivers. They could easily be the problem.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement