• Advertisement
Sign in to follow this  

How can i draw a line?

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

How can i draw a line?
linelist and linestrip dose not contain width.
and ID3DXLINE is a differnt world. it will not be change when i move the camera, or effects dosen't work for it. and etc.
sorry for my bad english!

Share this post


Link to post
Share on other sites
Advertisement
I haven't actually checked to see if this works, but you should be able to scale the line in the vertex shader . . .

I havent worked with lines, but it seems like it should work.

Share this post


Link to post
Share on other sites
Yeah, you are right. I was checking some of my old code where I remembered I used lines. There is no way to accomplish what you want using a primitive_line. If you want to draw lines of different sizes, you probably need to create four verts like this

D3DXVECTOR3 rect[4] = {

D3DXVECTOR3(-1.0f, 1.0f, 0,0f),
D3DXVECTOR3(1.0f, 1.0f, 0,0f),
D3DXVECTOR3(-1.0f, -1.0f, 0,0f),
D3DXVECTOR3(1.0f, -1.0f, 0,0f)
};

Then, make sure to scale it correctly so it represents a line (make it skinny) and then draw it where ever you need a line.

Share this post


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

  • Advertisement